Skip to content

feat(logs): Add Best Practices section to all SDK logs documentation#15935

Open
sergical wants to merge 1 commit intomasterfrom
sergiydybskiy/logs-best-practices-v2
Open

feat(logs): Add Best Practices section to all SDK logs documentation#15935
sergical wants to merge 1 commit intomasterfrom
sergiydybskiy/logs-best-practices-v2

Conversation

@sergical
Copy link
Member

@sergical sergical commented Jan 8, 2026

Summary

  • Creates platform-includes for Best Practices with SDK-specific code examples covering:
    • Wide Events Over Scattered Logs — Emit one comprehensive log per operation
    • Include Business Context — Add user tier, transaction data, feature flags
    • Consistent Attribute Naming — Use snake_case convention
  • Adds Best Practices section to all 20 SDK logs pages using <PlatformContent includePath="logs/best-practices" />
  • Replaces inline Best Practices in Next.js logs page with the platform-include

Platforms covered

JavaScript, Python, Go, Java, PHP, Ruby, .NET, Android, iOS, React Native, Dart/Flutter, Native, Godot, Unity, Unreal, Rust

Test plan

  • Verify build succeeds
  • Check Next.js logs page renders Best Practices correctly
  • Spot check a few other SDK logs pages

🤖 Generated with Claude Code

Creates platform-includes for best practices with SDK-specific code examples:
- Wide Events Over Scattered Logs
- Include Business Context
- Consistent Attribute Naming

Adds Best Practices section to all 20 SDK logs pages using platform-includes
for consistent documentation across JavaScript, Python, Go, Java, PHP, Ruby,
.NET, Android, iOS, React Native, Dart/Flutter, Native, Godot, Unity, Unreal,
and Rust.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jan 8, 2026 3:10pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Jan 8, 2026 3:10pm


Pick a naming convention and stick with it across your codebase. Inconsistent names make queries impossible.

**Recommended:** Use `snake_case` for custom attributes to match common conventions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: Our develop-docs use dot-namespacing, might be worth mentioning.

https://develop.sentry.dev/sdk/telemetry/logs/#default-attributes

Copy link
Member

@JoshuaMoelans JoshuaMoelans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Native page LGTM 🔥

Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The React Native part LGTM 🚀
Thank you for this enhancement 🙇

Also looping in @lucas-zimerman who has more context on the logs implementation in case he has more feedback 🙏

Copy link
Contributor

@sfanahata sfanahata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool. I did a similar thing for our /common/ file in #16195 - would be good to look over and modify to make sure not too much duplicate info is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants