From 2b18162a36e74397c98777672b36b960550ee201 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Wed, 18 Mar 2026 14:53:15 +0100 Subject: [PATCH 1/3] feat(attributes): Add cache.write attribute Indicates whether a cache operation resulted in a write to the cache. Always true for unconditional writes (put, remove, clear); reflects the actual outcome for conditional operations (putIfAbsent, replace) where the write may or may not occur depending on cache state. Co-Authored-By: Claude --- .../sentry-conventions/src/attributes.ts | 31 +++++++++++++++++++ model/attributes/cache/cache__write.json | 16 ++++++++++ python/src/sentry_conventions/attributes.py | 22 +++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 model/attributes/cache/cache__write.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 61d4bbad..cef53897 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -1287,6 +1287,26 @@ export const CACHE_OPERATION = 'cache.operation'; */ export type CACHE_OPERATION_TYPE = string; +// Path: model/attributes/cache/cache__write.json + +/** + * If the cache operation resulted in a write to the cache. `cache.write` + * + * Attribute Value Type: `boolean` {@link CACHE_WRITE_TYPE} + * + * Contains PII: false + * + * Attribute defined in OTEL: No + * + * @example true + */ +export const CACHE_WRITE = 'cache.write'; + +/** + * Type for {@link CACHE_WRITE} cache.write + */ +export type CACHE_WRITE_TYPE = boolean; + // Path: model/attributes/cache/cache__ttl.json /** @@ -11581,6 +11601,17 @@ export const ATTRIBUTE_METADATA: Record = { sdks: ['php-laravel'], changelog: [{ version: '0.1.0', prs: [127] }, { version: '0.0.0' }], }, + [CACHE_WRITE]: { + brief: 'If the cache operation resulted in a write to the cache.', + type: 'boolean', + pii: { + isPii: 'false', + }, + isInOtel: false, + example: true, + sdks: ['java'], + changelog: [{ version: '0.5.0' }], + }, [CACHE_TTL]: { brief: 'The ttl of the cache in seconds', type: 'integer', diff --git a/model/attributes/cache/cache__write.json b/model/attributes/cache/cache__write.json new file mode 100644 index 00000000..ec988dba --- /dev/null +++ b/model/attributes/cache/cache__write.json @@ -0,0 +1,16 @@ +{ + "key": "cache.write", + "brief": "If the cache operation resulted in a write to the cache.", + "type": "boolean", + "pii": { + "key": "false" + }, + "is_in_otel": false, + "example": true, + "sdks": ["java"], + "changelog": [ + { + "version": "0.5.0" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index af0a7b3f..4923e36e 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -927,6 +927,16 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "get" """ + # Path: model/attributes/cache/cache__write.json + CACHE_WRITE: Literal["cache.write"] = "cache.write" + """If the cache operation resulted in a write to the cache. + + Type: bool + Contains PII: false + Defined in OTEL: No + Example: True + """ + # Path: model/attributes/cache/cache__ttl.json CACHE_TTL: Literal["cache.ttl"] = "cache.ttl" """The ttl of the cache in seconds @@ -6177,6 +6187,17 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), + "cache.write": AttributeMetadata( + brief="If the cache operation resulted in a write to the cache.", + type=AttributeType.BOOLEAN, + pii=PiiInfo(isPii=IsPii.FALSE), + is_in_otel=False, + example=True, + sdks=["java"], + changelog=[ + ChangelogEntry(version="0.5.0"), + ], + ), "cache.ttl": AttributeMetadata( brief="The ttl of the cache in seconds", type=AttributeType.INTEGER, @@ -11052,6 +11073,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "cache.key": List[str], "cache.operation": str, "cache.ttl": int, + "cache.write": bool, "channel": str, "client.address": str, "client.port": int, From 3ddacfd4bd5124c811bdf0ef6e73a612ea9863d7 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 23 Mar 2026 15:03:26 +0100 Subject: [PATCH 2/3] run yarn generate --- .../sentry-conventions/src/attributes.ts | 57 ++++++++++--------- python/src/sentry_conventions/attributes.py | 42 +++++++------- 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 17da2b66..d1ec48dc 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -1407,45 +1407,45 @@ export const CACHE_OPERATION = 'cache.operation'; */ export type CACHE_OPERATION_TYPE = string; -// Path: model/attributes/cache/cache__write.json +// Path: model/attributes/cache/cache__ttl.json /** - * If the cache operation resulted in a write to the cache. `cache.write` + * The ttl of the cache in seconds `cache.ttl` * - * Attribute Value Type: `boolean` {@link CACHE_WRITE_TYPE} + * Attribute Value Type: `number` {@link CACHE_TTL_TYPE} * - * Contains PII: false + * Contains PII: maybe * * Attribute defined in OTEL: No * - * @example true + * @example 120 */ -export const CACHE_WRITE = 'cache.write'; +export const CACHE_TTL = 'cache.ttl'; /** - * Type for {@link CACHE_WRITE} cache.write + * Type for {@link CACHE_TTL} cache.ttl */ -export type CACHE_WRITE_TYPE = boolean; +export type CACHE_TTL_TYPE = number; -// Path: model/attributes/cache/cache__ttl.json +// Path: model/attributes/cache/cache__write.json /** - * The ttl of the cache in seconds `cache.ttl` + * If the cache operation resulted in a write to the cache. `cache.write` * - * Attribute Value Type: `number` {@link CACHE_TTL_TYPE} + * Attribute Value Type: `boolean` {@link CACHE_WRITE_TYPE} * - * Contains PII: maybe + * Contains PII: false * * Attribute defined in OTEL: No * - * @example 120 + * @example true */ -export const CACHE_TTL = 'cache.ttl'; +export const CACHE_WRITE = 'cache.write'; /** - * Type for {@link CACHE_TTL} cache.ttl + * Type for {@link CACHE_WRITE} cache.write */ -export type CACHE_TTL_TYPE = number; +export type CACHE_WRITE_TYPE = boolean; // Path: model/attributes/channel.json @@ -10049,6 +10049,7 @@ export const ATTRIBUTE_TYPE: Record = { [CACHE_KEY]: 'string[]', [CACHE_OPERATION]: 'string', [CACHE_TTL]: 'integer', + [CACHE_WRITE]: 'boolean', [CHANNEL]: 'string', [CLIENT_ADDRESS]: 'string', [CLIENT_PORT]: 'integer', @@ -10525,6 +10526,7 @@ export type AttributeName = | typeof CACHE_KEY | typeof CACHE_OPERATION | typeof CACHE_TTL + | typeof CACHE_WRITE | typeof CHANNEL | typeof CLIENT_ADDRESS | typeof CLIENT_PORT @@ -11799,17 +11801,6 @@ export const ATTRIBUTE_METADATA: Record = { sdks: ['php-laravel'], changelog: [{ version: '0.1.0', prs: [127] }, { version: '0.0.0' }], }, - [CACHE_WRITE]: { - brief: 'If the cache operation resulted in a write to the cache.', - type: 'boolean', - pii: { - isPii: 'false', - }, - isInOtel: false, - example: true, - sdks: ['java'], - changelog: [{ version: '0.5.0' }], - }, [CACHE_TTL]: { brief: 'The ttl of the cache in seconds', type: 'integer', @@ -11821,6 +11812,17 @@ export const ATTRIBUTE_METADATA: Record = { sdks: ['php-laravel'], changelog: [{ version: '0.4.0', prs: [228] }, { version: '0.0.0' }], }, + [CACHE_WRITE]: { + brief: 'If the cache operation resulted in a write to the cache.', + type: 'boolean', + pii: { + isPii: 'false', + }, + isInOtel: false, + example: true, + sdks: ['java'], + changelog: [{ version: '0.5.0' }], + }, [CHANNEL]: { brief: 'The channel name that is being used.', type: 'string', @@ -16722,6 +16724,7 @@ export type Attributes = { [CACHE_KEY]?: CACHE_KEY_TYPE; [CACHE_OPERATION]?: CACHE_OPERATION_TYPE; [CACHE_TTL]?: CACHE_TTL_TYPE; + [CACHE_WRITE]?: CACHE_WRITE_TYPE; [CHANNEL]?: CHANNEL_TYPE; [CLIENT_ADDRESS]?: CLIENT_ADDRESS_TYPE; [CLIENT_PORT]?: CLIENT_PORT_TYPE; diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 467acecb..417068a5 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -987,16 +987,6 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "get" """ - # Path: model/attributes/cache/cache__write.json - CACHE_WRITE: Literal["cache.write"] = "cache.write" - """If the cache operation resulted in a write to the cache. - - Type: bool - Contains PII: false - Defined in OTEL: No - Example: True - """ - # Path: model/attributes/cache/cache__ttl.json CACHE_TTL: Literal["cache.ttl"] = "cache.ttl" """The ttl of the cache in seconds @@ -1007,6 +997,16 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: 120 """ + # Path: model/attributes/cache/cache__write.json + CACHE_WRITE: Literal["cache.write"] = "cache.write" + """If the cache operation resulted in a write to the cache. + + Type: bool + Contains PII: false + Defined in OTEL: No + Example: true + """ + # Path: model/attributes/channel.json CHANNEL: Literal["channel"] = "channel" """The channel name that is being used. @@ -6357,17 +6357,6 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), - "cache.write": AttributeMetadata( - brief="If the cache operation resulted in a write to the cache.", - type=AttributeType.BOOLEAN, - pii=PiiInfo(isPii=IsPii.FALSE), - is_in_otel=False, - example=True, - sdks=["java"], - changelog=[ - ChangelogEntry(version="0.5.0"), - ], - ), "cache.ttl": AttributeMetadata( brief="The ttl of the cache in seconds", type=AttributeType.INTEGER, @@ -6380,6 +6369,17 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), + "cache.write": AttributeMetadata( + brief="If the cache operation resulted in a write to the cache.", + type=AttributeType.BOOLEAN, + pii=PiiInfo(isPii=IsPii.FALSE), + is_in_otel=False, + example=True, + sdks=["java"], + changelog=[ + ChangelogEntry(version="0.5.0"), + ], + ), "channel": AttributeMetadata( brief="The channel name that is being used.", type=AttributeType.STRING, From 2e2cd0977cd1c9cea3e28d8a3f479df3187f7446 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 26 Mar 2026 06:46:00 +0100 Subject: [PATCH 3/3] fix: Use 'next' version for cache.write changelog entry Replace hardcoded version 0.5.0 with 'next' so the version gets assigned automatically during the release process. Co-Authored-By: Claude --- javascript/sentry-conventions/src/attributes.ts | 2 +- model/attributes/cache/cache__write.json | 2 +- python/src/sentry_conventions/attributes.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index d1ec48dc..4926456f 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -11821,7 +11821,7 @@ export const ATTRIBUTE_METADATA: Record = { isInOtel: false, example: true, sdks: ['java'], - changelog: [{ version: '0.5.0' }], + changelog: [{ version: 'next' }], }, [CHANNEL]: { brief: 'The channel name that is being used.', diff --git a/model/attributes/cache/cache__write.json b/model/attributes/cache/cache__write.json index ec988dba..a2fb2a36 100644 --- a/model/attributes/cache/cache__write.json +++ b/model/attributes/cache/cache__write.json @@ -10,7 +10,7 @@ "sdks": ["java"], "changelog": [ { - "version": "0.5.0" + "version": "next" } ] } diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 417068a5..7f4080fa 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -6377,7 +6377,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): example=True, sdks=["java"], changelog=[ - ChangelogEntry(version="0.5.0"), + ChangelogEntry(version="next"), ], ), "channel": AttributeMetadata(