feat(attributes): Add more device context attributes#303
feat(attributes): Add more device context attributes#303
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>
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. |
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>
There was a problem hiding this comment.
Pull request overview
Adds missing device + network semantic convention attributes (per Sentry device contexts spec and OTel compatibility) to the attribute registry, and regenerates the language bindings and deprecated-attributes export.
Changes:
- Introduces new
device.*attributes for battery, storage, CPU, orientation, etc., plusnetwork.connection.type. - Deprecates
device.connection_typein favor ofnetwork.connection.type(with symmetric aliasing). - Regenerates shared deprecated-attributes JSON and the Python/JavaScript attribute bindings/metadata.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| shared/deprecated_attributes.json | Generated export updated to include newly deprecated device.connection_type. |
| python/src/sentry_conventions/attributes.py | Regenerated Python constants, metadata, and typing map for new attributes + deprecation handling. |
| javascript/sentry-conventions/src/attributes.ts | Regenerated TS constants, types, metadata, and attribute-type mappings for new attributes. |
| model/attributes/network/network__connection__type.json | Adds canonical network.connection.type (OTel) and aliases it with deprecated device.connection_type. |
| model/attributes/device/device__battery_level.json | Adds device.battery_level. |
| model/attributes/device/device__battery_temperature.json | Adds device.battery_temperature. |
| model/attributes/device/device__boot_time.json | Adds device.boot_time. |
| model/attributes/device/device__charging.json | Adds device.charging. |
| model/attributes/device/device__chipset.json | Adds device.chipset. |
| model/attributes/device/device__connection_type.json | Adds and deprecates device.connection_type, with replacement and alias to network.connection.type. |
| model/attributes/device/device__cpu_description.json | Adds device.cpu_description. |
| model/attributes/device/device__external_free_storage.json | Adds device.external_free_storage. |
| model/attributes/device/device__external_storage_size.json | Adds device.external_storage_size. |
| model/attributes/device/device__free_storage.json | Adds device.free_storage. |
| model/attributes/device/device__id.json | Adds device.id (OTel). |
| model/attributes/device/device__low_memory.json | Adds device.low_memory. |
| model/attributes/device/device__manufacturer.json | Adds device.manufacturer (OTel). |
| model/attributes/device/device__name.json | Adds device.name. |
| model/attributes/device/device__online.json | Adds device.online. |
| model/attributes/device/device__orientation.json | Adds device.orientation. |
| model/attributes/device/device__processor_frequency.json | Adds device.processor_frequency. |
| model/attributes/device/device__screen_density.json | Adds device.screen_density. |
| model/attributes/device/device__screen_dpi.json | Adds device.screen_dpi. |
| model/attributes/device/device__screen_height_pixels.json | Adds device.screen_height_pixels. |
| model/attributes/device/device__screen_width_pixels.json | Adds device.screen_width_pixels. |
| model/attributes/device/device__storage_size.json | Adds device.storage_size. |
| model/attributes/device/device__thermal_state.json | Adds device.thermal_state. |
| model/attributes/device/device__usable_memory.json | Adds device.usable_memory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lms24
left a comment
There was a problem hiding this comment.
Just to confirm: All of these are already sent from mobile SDKs today?
| @@ -0,0 +1,17 @@ | |||
| { | |||
| "key": "device.name", | |||
There was a problem hiding this comment.
OTel has device.model.name. Is there a semantic difference? Otherwise wdyt about using the OTel version?
There was a problem hiding this comment.
I think device.model.name is represented by our device.model.
and OTel device.model.identifier is device.model_id
I'd opt for the OTel one too, we can deprecate it at some point later
yes all attrs mentioned here (except for the new network connection attribute) are sent from mobile sdks under contexts in events |
…utes Resolve merge conflicts in network.connection.type attribute by combining both alias sets (device.connection_type and connectionType) and regenerating TS/Python attribute files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensure device.connection_type and connectionType both cross-reference all members of the alias group, matching network.connection.type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The generated files were missing aliases for device.connection_type and connectionType that were present in the source JSON definitions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add device.archs as a string array attribute representing CPU architectures of the device, e.g. arm64-v8a, armeabi-v7a, armeabi. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add device.timezone and device.locale as deprecated attributes in favor of culture.timezone and culture.locale respectively. Add symmetric aliases between the device and culture attribute pairs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 prepared a fix for the issue found in the latest run.
- ✅ Fixed: Missing PR references in deprecated attributes changelog
- Updated both device.locale and device.timezone entries in shared/deprecated_attributes.json to have "prs": [303] matching the source model files.
Or push these changes by commenting:
@cursor push dd1e762a49
Preview (dd1e762a49)
diff --git a/shared/deprecated_attributes.json b/shared/deprecated_attributes.json
--- a/shared/deprecated_attributes.json
+++ b/shared/deprecated_attributes.json
@@ -1551,7 +1551,7 @@
"changelog": [
{
"version": "next",
- "prs": [],
+ "prs": [303],
"description": "Added and deprecated device.locale in favor of culture.locale"
}
]
@@ -1574,7 +1574,7 @@
"changelog": [
{
"version": "next",
- "prs": [],
+ "prs": [303],
"description": "Added and deprecated device.timezone in favor of culture.timezone"
}
]This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ec28533. Configure here.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cale and device.timezone Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


Add device context and network connection attributes from the Sentry event schema that were previously missing from sentry-conventions.
Device context attributes:
device.battery_level,device.battery_temperature,device.boot_time,device.chargingdevice.chipset,device.cpu_description,device.id,device.low_memorydevice.manufacturer,device.name,device.online,device.orientationdevice.processor_frequency,device.processor_count,device.screen_density,device.screen_dpidevice.screen_height_pixels,device.screen_width_pixelsdevice.storage_size,device.free_storage,device.external_storage_size,device.external_free_storagedevice.memory_size,device.free_memory,device.usable_memorydevice.thermal_statedevice.archs(string array for CPU architectures)device.connection_type(deprecated in favor ofnetwork.connection.type)device.timezone(deprecated in favor ofculture.timezone)device.locale(deprecated in favor ofculture.locale)Deprecated attributes have symmetric aliases with their replacements and use
backfilldeprecation status per repo policy.