feat(attributes): Add app context attributes for mobile#296
feat(attributes): Add app context attributes for mobile#296
Conversation
Add app.name, app.identifier, app.version, app.build, app.start_time, and app.in_foreground attributes for mobile app context metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These are redundant with sentry.release which already contains the app identifier, version, and build number. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Also derivable from existing context and sentry.release. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…uild These provide standalone structured values independent of how sentry.release is formatted by the user. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧Deps
Deps Dev
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Pull request overview
Adds a set of mobile-focused application context attributes under the app.* namespace to the semantic conventions registry and regenerates the language bindings (Python + TypeScript) to expose them consistently.
Changes:
- Introduces six new
app.*attributes in the registry (model/attributes/app/*.json) with SDK scoping for mobile SDKs. - Regenerates Python attribute name/constants, metadata map, and typed attribute mapping to include the new keys.
- Regenerates TypeScript attribute constants/types, metadata, and attribute typing to include the new keys.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| python/src/sentry_conventions/attributes.py | Adds new APP_* constants, metadata entries, and typed mappings for app.* attributes. |
| model/attributes/app/app__build.json | Defines registry entry for app.build. |
| model/attributes/app/app__identifier.json | Defines registry entry for app.identifier. |
| model/attributes/app/app__in_foreground.json | Defines registry entry for app.in_foreground. |
| model/attributes/app/app__name.json | Defines registry entry for app.name. |
| model/attributes/app/app__start_time.json | Defines registry entry for app.start_time. |
| model/attributes/app/app__version.json | Defines registry entry for app.version. |
| javascript/sentry-conventions/src/attributes.ts | Adds TypeScript constants/types, metadata, and attribute typing for the new app.* keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
A boolean value cannot contain personal data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
app.start_time, app.version, app.identifier, and app.build cannot contain personal data. app.name remains maybe. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set pii to maybe for app.version, app.build, app.start_time, and app.identifier to be consistent with analogous attributes like browser.version, os.version, and os.build_id. Only app.in_foreground remains false as a boolean cannot contain PII. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Description
Add mobile app context attributes under the
app.*namespace:app.name— Human readable application nameapp.identifier— Version-independent application identifier (bundle ID)app.version— Human readable application versionapp.build— Internal build identifierapp.start_time— UTC timestamp when the user started the applicationapp.in_foreground— Whether the application is currently in the foregroundAll attributes are scoped to mobile SDKs:
sentry.cocoa,sentry.java.android,sentry.javascript.react-native,sentry.dart.flutterand are already used today.PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)pii(i.e.maybeortrue. Usefalseonly for values that should never be scrubbed such as IDs)