feat(attributes): Add sentry.mobile and sentry.main_thread attributes#317
feat(attributes): Add sentry.mobile and sentry.main_thread attributes#317
sentry.mobile and sentry.main_thread attributes#317Conversation
…utes Both attributes are computed by Relay and should not be set by SDKs. Co-Authored-By: Claude Opus 4.6 (1M context) <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
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Pull request overview
Adds two new Sentry-specific attributes (sentry.mobile, sentry.main_thread) to the attribute model and propagates them into the generated TypeScript and Python conventions packages.
Changes:
- Added new attribute model definitions:
sentry.mobileandsentry.main_thread. - Updated generated attribute constants/types/metadata in JavaScript and Python to include the new attributes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
model/attributes/sentry/sentry__mobile.json |
Defines the new sentry.mobile boolean attribute in the source model. |
model/attributes/sentry/sentry__main_thread.json |
Defines the new sentry.main_thread boolean attribute in the source model. |
javascript/sentry-conventions/src/attributes.ts |
Adds generated TS constants/types/metadata entries for the new attributes. |
python/src/sentry_conventions/attributes.py |
Adds generated Python constants/metadata/type mappings for the new attributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…hread These are simple boolean flags that cannot contain personally identifiable information. Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Reviewed by Cursor Bugbot for commit c496f1b. Configure here.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Lms24
left a comment
There was a problem hiding this comment.
LGTM, wondering though if we should add a flag to the attribute schema that we can use to determine which component in the stack (SDK, Relay, Product) is expected to set the attribute. Probably warrants greater discussion though so feel free to just merge this as-is.
agreed! filed an issue: #320 |

Description
Add two Sentry attributes (note these are also pre-computed by relay in v1 transactions and used today in transactions):
sentry.mobile— Whether a mobile SDK is being used.sentry.main_thread— Whether the event occurred on the main thread.Both attributes are computed by Relay and should not be set by SDKs.
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)