feat(attributes): Add remaining app context attributes#304
feat(attributes): Add remaining app context attributes#304
Conversation
Add 18 new device context attributes that were defined in the Sentry event spec but missing from conventions: battery_level, battery_temperature, boot_time, charging, free_storage, id, low_memory, manufacturer, name, online, orientation, processor_frequency, screen_density, screen_dpi, screen_height_pixels, screen_width_pixels, storage_size, and usable_memory. device.id and device.manufacturer are marked as OTel attributes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ibutes Add device.chipset, device.cpu_description, device.external_storage_size, device.external_free_storage, device.thermal_state, device.connection_type (deprecated), and network.connection.type (OTel) attributes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…onnection_type 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
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
heads-up: array attributes don't yet get forwarded by Relay afaik. But I think the definition makes sense, so let's keep it.
There was a problem hiding this comment.
Acknowledged — keeping the array attribute definition as-is. Good to know about the Relay forwarding limitation.
— Claude Code
There was a problem hiding this comment.
Pull request overview
Adds missing mobile app context attributes and aligns several existing app attribute keys with the actual payload keys, including updated PII classifications.
Changes:
- Added new app context attributes:
app.view_names,app.is_split_apks, and dynamicapp.permissions.<key>. - Renamed existing app attributes to
app.app_*keys to match payload fields. - Updated PII classification for
app.in_foreground(and set new attributes’ PII tomaybe).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| python/src/sentry_conventions/attributes.py | Updates Python attribute name constants, metadata, and type hints for new/renamed app attributes. |
| javascript/sentry-conventions/src/attributes.ts | Updates TS exports, metadata, and typing maps for new/renamed app attributes. |
| model/attributes/app/app__view_names.json | Adds app.view_names attribute definition. |
| model/attributes/app/app__permissions__[key].json | Adds dynamic-suffix app.permissions.<key> attribute definition. |
| model/attributes/app/app__is_split_apks.json | Adds app.is_split_apks attribute definition. |
| model/attributes/app/app__in_foreground.json | Updates PII classification for app.in_foreground. |
| model/attributes/app/app__app_build.json | Renames key to app.app_build. |
| model/attributes/app/app__app_identifier.json | Renames key to app.app_identifier. |
| model/attributes/app/app__app_name.json | Renames key to app.app_name. |
| model/attributes/app/app__app_start_time.json | Renames key to app.app_start_time. |
| model/attributes/app/app__app_version.json | Renames key to app.app_version. |
Comments suppressed due to low confidence (5)
model/attributes/app/app__app_build.json:2
- The attribute
keyhas been renamed toapp.app_build, but the changelog entry still says "Added app.build attribute". Update the changelog description to referenceapp.app_build(or explicitly describe this as a rename).
model/attributes/app/app__app_start_time.json:2 - The attribute
keyhas been renamed toapp.app_start_time, but the changelog entry still says "Added app.start_time attribute". Update the changelog description to referenceapp.app_start_time(or explicitly describe this as a rename).
model/attributes/app/app__app_version.json:2 - The attribute
keyhas been renamed toapp.app_version, but the changelog entry still says "Added app.version attribute". Update the changelog description to referenceapp.app_version(or explicitly describe this as a rename).
model/attributes/app/app__app_identifier.json:2 - The attribute
keyhas been renamed toapp.app_identifier, but the changelog entry still says "Added app.identifier attribute". Update the changelog description to referenceapp.app_identifier(or explicitly describe this as a rename).
model/attributes/app/app__app_name.json:2 - The attribute
keyhas been renamed toapp.app_name, but the changelog entry still says "Added app.name attribute". Update the changelog description to referenceapp.app_name(or explicitly describe this as a rename).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…o canonical app.* names Instead of renaming app.build to app.app_build, keep app.build as canonical and add app.app_build as a deprecated attribute with backfill status that aliases to app.build. Same pattern for app_identifier, app_name, app_start_time, and app_version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25b54f0 to
278a080
Compare
Resolve merge conflicts in network.connection.type by combining both alias sets and regenerating TS/Python attribute files. 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.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Add remaining app context attributes and rename existing ones to match payload keys.
New attributes:
app.view_names(string[]) — active view/fragment namesapp.is_split_apks(boolean) — whether the app uses split APKs (Android)app.permissions.<key>(string, dynamic suffix) — permission granted statusStable -> Deprecated attributes:
app.build→app.app_buildapp.identifier→app.app_identifierapp.name→app.app_nameapp.start_time→app.app_start_timeapp.version→app.app_versionPII updates:
app.in_foregroundPII changed fromfalsetomaybeapp.is_split_apksandapp.permissions.<key>set to PIImaybePR 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)