Repository navigation
feat(attributes): Add device.low_power_mode attribute for iOS - #314
Merged
Merged
Conversation
itaybre
requested review from
a team,
Lms24,
cleptric,
lcian,
mjq and
nsdeschenes
as code owners
April 8, 2026 21:04
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed: Python bindings missing metadata and TypedDict entries
- Added device.low_power_mode entries to both ATTRIBUTE_METADATA dictionary and Attributes TypedDict in correct alphabetical position.
- ✅ Fixed: TypeScript Attributes type missing new attribute entry
- Added [DEVICE_LOW_POWER_MODE]?: DEVICE_LOW_POWER_MODE_TYPE entry to the Attributes type in correct alphabetical position.
- ✅ Fixed: New attribute placed in wrong alphabetical position
- Moved all DEVICE_LOW_POWER_MODE entries from after DEVICE_SIMULATOR to between DEVICE_FREE_MEMORY and DEVICE_MEMORY_ESTIMATED_CAPACITY in all sections of both files.
Or push these changes by commenting:
@cursor push 7293ba5b57
Preview (7293ba5b57)
diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts
--- a/javascript/sentry-conventions/src/attributes.ts
+++ b/javascript/sentry-conventions/src/attributes.ts
@@ -2345,6 +2345,26 @@
*/
export type DEVICE_FREE_MEMORY_TYPE = number;
+// Path: model/attributes/device/device__low_power_mode.json
+
+/**
+ * Whether the device is in Low Power Mode. `device.low_power_mode`
+ *
+ * Attribute Value Type: `boolean` {@link DEVICE_LOW_POWER_MODE_TYPE}
+ *
+ * Contains PII: false
+ *
+ * Attribute defined in OTEL: No
+ *
+ * @example true
+ */
+export const DEVICE_LOW_POWER_MODE = 'device.low_power_mode';
+
+/**
+ * Type for {@link DEVICE_LOW_POWER_MODE} device.low_power_mode
+ */
+export type DEVICE_LOW_POWER_MODE_TYPE = boolean;
+
// Path: model/attributes/device/device__memory__estimated_capacity.json
/**
@@ -2469,26 +2489,6 @@
*/
export type DEVICE_SIMULATOR_TYPE = boolean;
-// Path: model/attributes/device/device__low_power_mode.json
-
-/**
- * Whether the device is in Low Power Mode. `device.low_power_mode`
- *
- * Attribute Value Type: `boolean` {@link DEVICE_LOW_POWER_MODE_TYPE}
- *
- * Contains PII: false
- *
- * Attribute defined in OTEL: No
- *
- * @example true
- */
-export const DEVICE_LOW_POWER_MODE = 'device.low_power_mode';
-
-/**
- * Type for {@link DEVICE_LOW_POWER_MODE} device.low_power_mode
- */
-export type DEVICE_LOW_POWER_MODE_TYPE = boolean;
-
// Path: model/attributes/effectiveConnectionType.json
/**
@@ -10347,13 +10347,13 @@
[DEVICE_CLASS]: 'string',
[DEVICE_FAMILY]: 'string',
[DEVICE_FREE_MEMORY]: 'integer',
+ [DEVICE_LOW_POWER_MODE]: 'boolean',
[DEVICE_MEMORY_ESTIMATED_CAPACITY]: 'integer',
[DEVICE_MEMORY_SIZE]: 'integer',
[DEVICE_MODEL]: 'string',
[DEVICE_MODEL_ID]: 'string',
[DEVICE_PROCESSOR_COUNT]: 'integer',
[DEVICE_SIMULATOR]: 'boolean',
- [DEVICE_LOW_POWER_MODE]: 'boolean',
[EFFECTIVECONNECTIONTYPE]: 'string',
[ENVIRONMENT]: 'string',
[ERROR_TYPE]: 'string',
@@ -10836,13 +10836,13 @@
| typeof DEVICE_CLASS
| typeof DEVICE_FAMILY
| typeof DEVICE_FREE_MEMORY
+ | typeof DEVICE_LOW_POWER_MODE
| typeof DEVICE_MEMORY_ESTIMATED_CAPACITY
| typeof DEVICE_MEMORY_SIZE
| typeof DEVICE_MODEL
| typeof DEVICE_MODEL_ID
| typeof DEVICE_PROCESSOR_COUNT
| typeof DEVICE_SIMULATOR
- | typeof DEVICE_LOW_POWER_MODE
| typeof EFFECTIVECONNECTIONTYPE
| typeof ENVIRONMENT
| typeof ERROR_TYPE
@@ -12644,6 +12644,17 @@
example: 2147483648,
changelog: [{ version: 'next', prs: [300], description: 'Added device.free_memory attribute' }],
},
+ [DEVICE_LOW_POWER_MODE]: {
+ brief: 'Whether the device is in Low Power Mode.',
+ type: 'boolean',
+ pii: {
+ isPii: 'false',
+ },
+ isInOtel: false,
+ sdks: ['sentry.cocoa'],
+ example: true,
+ changelog: [{ version: 'next', description: 'Added device.low_power_mode attribute' }],
+ },
[DEVICE_MEMORY_ESTIMATED_CAPACITY]: {
brief:
'The estimated total memory capacity of the device, only a rough estimation in gigabytes. Browsers report estimations in buckets of powers of 2, mostly capped at 8 GB',
@@ -12725,17 +12736,6 @@
example: false,
changelog: [{ version: 'next', prs: [300], description: 'Added device.simulator attribute' }],
},
- [DEVICE_LOW_POWER_MODE]: {
- brief: 'Whether the device is in Low Power Mode.',
- type: 'boolean',
- pii: {
- isPii: 'false',
- },
- isInOtel: false,
- sdks: ['sentry.cocoa'],
- example: true,
- changelog: [{ version: 'next', description: 'Added device.low_power_mode attribute' }],
- },
[EFFECTIVECONNECTIONTYPE]: {
brief: 'Specifies the estimated effective type of the current connection (e.g. slow-2g, 2g, 3g, 4g).',
type: 'string',
@@ -17239,6 +17239,7 @@
[DEVICE_CLASS]?: DEVICE_CLASS_TYPE;
[DEVICE_FAMILY]?: DEVICE_FAMILY_TYPE;
[DEVICE_FREE_MEMORY]?: DEVICE_FREE_MEMORY_TYPE;
+ [DEVICE_LOW_POWER_MODE]?: DEVICE_LOW_POWER_MODE_TYPE;
[DEVICE_MEMORY_ESTIMATED_CAPACITY]?: DEVICE_MEMORY_ESTIMATED_CAPACITY_TYPE;
[DEVICE_MEMORY_SIZE]?: DEVICE_MEMORY_SIZE_TYPE;
[DEVICE_MODEL]?: DEVICE_MODEL_TYPE;
diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py
--- a/python/src/sentry_conventions/attributes.py
+++ b/python/src/sentry_conventions/attributes.py
@@ -1462,6 +1462,16 @@
Example: 2147483648
"""
+ # Path: model/attributes/device/device__low_power_mode.json
+ DEVICE_LOW_POWER_MODE: Literal["device.low_power_mode"] = "device.low_power_mode"
+ """Whether the device is in Low Power Mode.
+
+ Type: bool
+ Contains PII: false
+ Defined in OTEL: No
+ Example: true
+ """
+
# Path: model/attributes/device/device__memory__estimated_capacity.json
DEVICE_MEMORY_ESTIMATED_CAPACITY: Literal["device.memory.estimated_capacity"] = (
"device.memory.estimated_capacity"
@@ -1526,16 +1536,6 @@
Example: false
"""
- # Path: model/attributes/device/device__low_power_mode.json
- DEVICE_LOW_POWER_MODE: Literal["device.low_power_mode"] = "device.low_power_mode"
- """Whether the device is in Low Power Mode.
-
- Type: bool
- Contains PII: false
- Defined in OTEL: No
- Example: true
- """
-
# Path: model/attributes/deviceMemory.json
DEVICEMEMORY: Literal["deviceMemory"] = "deviceMemory"
"""The estimated total memory capacity of the device, only a rough estimation in gigabytes.
@@ -7047,6 +7047,20 @@
),
],
),
+ "device.low_power_mode": AttributeMetadata(
+ brief="Whether the device is in Low Power Mode.",
+ type=AttributeType.BOOLEAN,
+ pii=PiiInfo(isPii=IsPii.FALSE),
+ is_in_otel=False,
+ example=True,
+ sdks=["sentry.cocoa"],
+ changelog=[
+ ChangelogEntry(
+ version="next",
+ description="Added device.low_power_mode attribute",
+ ),
+ ],
+ ),
"device.memory.estimated_capacity": AttributeMetadata(
brief="The estimated total memory capacity of the device, only a rough estimation in gigabytes. Browsers report estimations in buckets of powers of 2, mostly capped at 8 GB",
type=AttributeType.INTEGER,
@@ -11613,6 +11627,7 @@
"device.class": str,
"device.family": str,
"device.free_memory": int,
+ "device.low_power_mode": bool,
"device.memory.estimated_capacity": int,
"device.memory_size": int,
"device.model": str,This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f95b230. Configure here.
buenaflor
reviewed
Apr 16, 2026
4 tasks done
…eat/device-low-power-mode
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
device.low_power_modeboolean attribute to document whether an iOS device is in Low Power Modesentry.cocoaSDKattributes.ts) and Python (attributes.py) bindingsTest plan
yarn test:jspassesprsfield inmodel/attributes/device/device__low_power_mode.jsonchangelog🤖 Generated with Claude Code