From f95b23039d41b843a3292915da0c8f173cfda992 Mon Sep 17 00:00:00 2001 From: Itay Brenner Date: Wed, 8 Apr 2026 18:03:54 -0300 Subject: [PATCH] feat(attributes): Add device.low_power_mode attribute for iOS --- .../sentry-conventions/src/attributes.ts | 33 +++++++++++++++++++ .../device/device__low_power_mode.json | 17 ++++++++++ python/src/sentry_conventions/attributes.py | 10 ++++++ 3 files changed, 60 insertions(+) create mode 100644 model/attributes/device/device__low_power_mode.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 6e68f75d..4c6a6870 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -2469,6 +2469,26 @@ export const DEVICE_SIMULATOR = 'device.simulator'; */ 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 /** @@ -10333,6 +10353,7 @@ export const ATTRIBUTE_TYPE: Record = { [DEVICE_MODEL_ID]: 'string', [DEVICE_PROCESSOR_COUNT]: 'integer', [DEVICE_SIMULATOR]: 'boolean', + [DEVICE_LOW_POWER_MODE]: 'boolean', [EFFECTIVECONNECTIONTYPE]: 'string', [ENVIRONMENT]: 'string', [ERROR_TYPE]: 'string', @@ -10821,6 +10842,7 @@ export type AttributeName = | typeof DEVICE_MODEL_ID | typeof DEVICE_PROCESSOR_COUNT | typeof DEVICE_SIMULATOR + | typeof DEVICE_LOW_POWER_MODE | typeof EFFECTIVECONNECTIONTYPE | typeof ENVIRONMENT | typeof ERROR_TYPE @@ -12703,6 +12725,17 @@ export const ATTRIBUTE_METADATA: Record = { 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', diff --git a/model/attributes/device/device__low_power_mode.json b/model/attributes/device/device__low_power_mode.json new file mode 100644 index 00000000..13f53c1e --- /dev/null +++ b/model/attributes/device/device__low_power_mode.json @@ -0,0 +1,17 @@ +{ + "key": "device.low_power_mode", + "brief": "Whether the device is in Low Power Mode.", + "type": "boolean", + "pii": { + "key": "false" + }, + "is_in_otel": false, + "sdks": ["sentry.cocoa"], + "example": true, + "changelog": [ + { + "version": "next", + "description": "Added device.low_power_mode attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index a1602e9b..289db6fb 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -1526,6 +1526,16 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): 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.