From aca5375815665cfa79cec11cb978c61e1324aee7 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:28:15 +0100 Subject: [PATCH 1/7] feat: add gen_ai.input.messages original length attribute --- generated/attributes/all.md | 3 +- generated/attributes/sentry.md | 12 +++++++ .../sentry-conventions/src/attributes.ts | 33 +++++++++++++++++++ ..._ai__input__messages__original_length.json | 10 ++++++ python/src/sentry_conventions/attributes.py | 20 +++++++++++ 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json diff --git a/generated/attributes/all.md b/generated/attributes/all.md index 2a7af162..94fa668d 100644 --- a/generated/attributes/all.md +++ b/generated/attributes/all.md @@ -4,7 +4,7 @@ This page lists all available attributes across all categories. -Total attributes: 423 +Total attributes: 424 ## Stable Attributes @@ -277,6 +277,7 @@ Total attributes: 423 | [`sentry.release`](./sentry.md#sentryrelease) | The sentry release. | | [`sentry.replay_id`](./sentry.md#sentryreplay_id) | The id of the sentry replay. | | [`sentry.replay_is_buffering`](./sentry.md#sentryreplay_is_buffering) | A sentinel attribute on log events indicating whether the current Session Replay is being buffered (onErrorSampleRate). | +| [`sentry.sdk_meta.gen_ai.input.messages.original_length`](./sentry.md#sentrysdk_metagen_aiinputmessagesoriginal_length) | The original length of gen_ai.input.messages before any truncation or modification. | | [`sentry.sdk.integrations`](./sentry.md#sentrysdkintegrations) | A list of names identifying enabled integrations. The list shouldhave all enabled integrations, including default integrations. Defaultintegrations are included because different SDK releases may contain differentdefault integrations. | | [`sentry.sdk.name`](./sentry.md#sentrysdkname) | The sentry sdk name. | | [`sentry.sdk.version`](./sentry.md#sentrysdkversion) | The sentry sdk version. | diff --git a/generated/attributes/sentry.md b/generated/attributes/sentry.md index a9b2d24d..d0c5d7e0 100644 --- a/generated/attributes/sentry.md +++ b/generated/attributes/sentry.md @@ -41,6 +41,7 @@ - [sentry.release](#sentryrelease) - [sentry.replay_id](#sentryreplay_id) - [sentry.replay_is_buffering](#sentryreplay_is_buffering) + - [sentry.sdk_meta.gen_ai.input.messages.original_length](#sentrysdk_metagen_aiinputmessagesoriginal_length) - [sentry.sdk.integrations](#sentrysdkintegrations) - [sentry.sdk.name](#sentrysdkname) - [sentry.sdk.version](#sentrysdkversion) @@ -480,6 +481,17 @@ A sentinel attribute on log events indicating whether the current Session Replay | Exists in OpenTelemetry | No | | Example | `true` | +### sentry.sdk_meta.gen_ai.input.messages.original_length + +The original length of gen_ai.input.messages before any truncation or modification. + +| Property | Value | +| --- | --- | +| Type | `integer` | +| Has PII | false | +| Exists in OpenTelemetry | No | +| Example | `5` | + ### sentry.sdk.integrations A list of names identifying enabled integrations. The list shouldhave all enabled integrations, including default integrations. Defaultintegrations are included because different SDK releases may contain differentdefault integrations. diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 5abb1662..cb76b25e 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -7149,6 +7149,27 @@ export const SENTRY_SDK_INTEGRATIONS = 'sentry.sdk.integrations'; */ export type SENTRY_SDK_INTEGRATIONS_TYPE = Array; +// Path: model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json + +/** + * The original length of gen_ai.input.messages before any truncation or modification. `sentry.sdk_meta.gen_ai.input.messages.original_length` + * + * Attribute Value Type: `number` {@link SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_TYPE} + * + * Contains PII: false + * + * Attribute defined in OTEL: No + * + * @example 5 + */ +export const SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH = + 'sentry.sdk_meta.gen_ai.input.messages.original_length'; + +/** + * Type for {@link SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH} sentry.sdk_meta.gen_ai.input.messages.original_length + */ +export type SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_TYPE = number; + // Path: model/attributes/sentry/sentry__sdk__name.json /** @@ -9171,6 +9192,7 @@ export const ATTRIBUTE_TYPE: Record = { [SENTRY_REPLAY_ID]: 'string', [SENTRY_REPLAY_IS_BUFFERING]: 'boolean', [SENTRY_SDK_INTEGRATIONS]: 'string[]', + [SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH]: 'integer', [SENTRY_SDK_NAME]: 'string', [SENTRY_SDK_VERSION]: 'string', [SENTRY_SEGMENT_ID]: 'string', @@ -9597,6 +9619,7 @@ export type AttributeName = | typeof SENTRY_REPLAY_ID | typeof SENTRY_REPLAY_IS_BUFFERING | typeof SENTRY_SDK_INTEGRATIONS + | typeof SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH | typeof SENTRY_SDK_NAME | typeof SENTRY_SDK_VERSION | typeof SENTRY_SEGMENT_ID @@ -13254,6 +13277,15 @@ export const ATTRIBUTE_METADATA: Record = { isInOtel: false, example: ['InboundFilters', 'FunctionToString', 'BrowserApiErrors', 'Breadcrumbs'], }, + [SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH]: { + brief: 'The original length of gen_ai.input.messages before any truncation or modification.', + type: 'integer', + pii: { + isPii: 'false', + }, + isInOtel: false, + example: 5, + }, [SENTRY_SDK_NAME]: { brief: 'The sentry sdk name.', type: 'string', @@ -14359,6 +14391,7 @@ export type Attributes = { [SENTRY_REPLAY_ID]?: SENTRY_REPLAY_ID_TYPE; [SENTRY_REPLAY_IS_BUFFERING]?: SENTRY_REPLAY_IS_BUFFERING_TYPE; [SENTRY_SDK_INTEGRATIONS]?: SENTRY_SDK_INTEGRATIONS_TYPE; + [SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH]?: SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_TYPE; [SENTRY_SDK_NAME]?: SENTRY_SDK_NAME_TYPE; [SENTRY_SDK_VERSION]?: SENTRY_SDK_VERSION_TYPE; [SENTRY_SEGMENT_ID]?: SENTRY_SEGMENT_ID_TYPE; diff --git a/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json b/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json new file mode 100644 index 00000000..ae36db8f --- /dev/null +++ b/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json @@ -0,0 +1,10 @@ +{ + "key": "sentry.sdk_meta.gen_ai.input.messages.original_length", + "brief": "The original length of gen_ai.input.messages before any truncation or modification.", + "type": "integer", + "pii": { + "key": "false" + }, + "is_in_otel": false, + "example": 5 +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 4a0af1e7..8c75faab 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -4008,6 +4008,18 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "7.0.0" """ + # Path: model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json + SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH: Literal[ + "sentry.sdk_meta.gen_ai.input.messages.original_length" + ] = "sentry.sdk_meta.gen_ai.input.messages.original_length" + """The original length of gen_ai.input.messages before any truncation or modification. + + Type: int + Contains PII: false + Defined in OTEL: No + Example: 5 + """ + # Path: model/attributes/sentry/sentry__segment__id.json SENTRY_SEGMENT_ID: Literal["sentry.segment.id"] = "sentry.segment.id" """The segment ID of a span @@ -7555,6 +7567,13 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): is_in_otel=False, example="7.0.0", ), + "sentry.sdk_meta.gen_ai.input.messages.original_length": AttributeMetadata( + brief="The original length of gen_ai.input.messages before any truncation or modification.", + type=AttributeType.INTEGER, + pii=PiiInfo(isPii=IsPii.FALSE), + is_in_otel=False, + example=5, + ), "sentry.segment.id": AttributeMetadata( brief="The segment ID of a span", type=AttributeType.STRING, @@ -8479,6 +8498,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "sentry.sdk.integrations": List[str], "sentry.sdk.name": str, "sentry.sdk.version": str, + "sentry.sdk_meta.gen_ai.input.messages.original_length": int, "sentry.segment.id": str, "sentry.segment.name": str, "sentry.segment_id": str, From f3035c703f08a100dded49a7cd285466be93eea4 Mon Sep 17 00:00:00 2001 From: Ogi Date: Fri, 30 Jan 2026 13:33:47 +0100 Subject: [PATCH 2/7] Update generated/attributes/sentry.md Co-authored-by: Simon Hellmayr --- generated/attributes/sentry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/attributes/sentry.md b/generated/attributes/sentry.md index d0c5d7e0..590b63c4 100644 --- a/generated/attributes/sentry.md +++ b/generated/attributes/sentry.md @@ -483,7 +483,7 @@ A sentinel attribute on log events indicating whether the current Session Replay ### sentry.sdk_meta.gen_ai.input.messages.original_length -The original length of gen_ai.input.messages before any truncation or modification. +The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). | Property | Value | | --- | --- | From 9e8af4e355ea2f2fc31118e3e12f16ac248650c5 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Mon, 2 Feb 2026 13:20:50 +0100 Subject: [PATCH 3/7] reformat --- generated/attributes/sentry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/attributes/sentry.md b/generated/attributes/sentry.md index 590b63c4..d0c5d7e0 100644 --- a/generated/attributes/sentry.md +++ b/generated/attributes/sentry.md @@ -483,7 +483,7 @@ A sentinel attribute on log events indicating whether the current Session Replay ### sentry.sdk_meta.gen_ai.input.messages.original_length -The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). +The original length of gen_ai.input.messages before any truncation or modification. | Property | Value | | --- | --- | From d7d59460c175a9a7f1993bc6c2166f4875a4b8e3 Mon Sep 17 00:00:00 2001 From: Ogi Date: Mon, 2 Feb 2026 13:36:55 +0100 Subject: [PATCH 4/7] Update generated/attributes/sentry.md Co-authored-by: Simon Hellmayr --- generated/attributes/sentry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/attributes/sentry.md b/generated/attributes/sentry.md index d0c5d7e0..590b63c4 100644 --- a/generated/attributes/sentry.md +++ b/generated/attributes/sentry.md @@ -483,7 +483,7 @@ A sentinel attribute on log events indicating whether the current Session Replay ### sentry.sdk_meta.gen_ai.input.messages.original_length -The original length of gen_ai.input.messages before any truncation or modification. +The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). | Property | Value | | --- | --- | From 5257ca82d216b5e830bec27f8e649438d95f959c Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Mon, 2 Feb 2026 13:38:56 +0100 Subject: [PATCH 5/7] fix comment --- generated/attributes/all.md | 2 +- javascript/sentry-conventions/src/attributes.ts | 5 +++-- ...__sdk_meta__gen_ai__input__messages__original_length.json | 2 +- python/src/sentry_conventions/attributes.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/generated/attributes/all.md b/generated/attributes/all.md index 220c48f2..75f2a005 100644 --- a/generated/attributes/all.md +++ b/generated/attributes/all.md @@ -277,7 +277,7 @@ Total attributes: 424 | [`sentry.release`](./sentry.md#sentryrelease) | The sentry release. | | [`sentry.replay_id`](./sentry.md#sentryreplay_id) | The id of the sentry replay. | | [`sentry.replay_is_buffering`](./sentry.md#sentryreplay_is_buffering) | A sentinel attribute on log events indicating whether the current Session Replay is being buffered (onErrorSampleRate). | -| [`sentry.sdk_meta.gen_ai.input.messages.original_length`](./sentry.md#sentrysdk_metagen_aiinputmessagesoriginal_length) | The original length of gen_ai.input.messages before any truncation or modification. | +| [`sentry.sdk_meta.gen_ai.input.messages.original_length`](./sentry.md#sentrysdk_metagen_aiinputmessagesoriginal_length) | The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). | | [`sentry.sdk.integrations`](./sentry.md#sentrysdkintegrations) | A list of names identifying enabled integrations. The list shouldhave all enabled integrations, including default integrations. Defaultintegrations are included because different SDK releases may contain differentdefault integrations. | | [`sentry.sdk.name`](./sentry.md#sentrysdkname) | The sentry sdk name. | | [`sentry.sdk.version`](./sentry.md#sentrysdkversion) | The sentry sdk version. | diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index ab7a7184..6612900c 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -7152,7 +7152,7 @@ export type SENTRY_SDK_INTEGRATIONS_TYPE = Array; // Path: model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json /** - * The original length of gen_ai.input.messages before any truncation or modification. `sentry.sdk_meta.gen_ai.input.messages.original_length` + * The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). `sentry.sdk_meta.gen_ai.input.messages.original_length` * * Attribute Value Type: `number` {@link SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_TYPE} * @@ -13278,7 +13278,8 @@ export const ATTRIBUTE_METADATA: Record = { example: ['InboundFilters', 'FunctionToString', 'BrowserApiErrors', 'Breadcrumbs'], }, [SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH]: { - brief: 'The original length of gen_ai.input.messages before any truncation or modification.', + brief: + 'The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s).', type: 'integer', pii: { isPii: 'false', diff --git a/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json b/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json index ae36db8f..346da622 100644 --- a/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json +++ b/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json @@ -1,6 +1,6 @@ { "key": "sentry.sdk_meta.gen_ai.input.messages.original_length", - "brief": "The original length of gen_ai.input.messages before any truncation or modification.", + "brief": "The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s).", "type": "integer", "pii": { "key": "false" diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index ee763b58..3f969545 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -4012,7 +4012,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH: Literal[ "sentry.sdk_meta.gen_ai.input.messages.original_length" ] = "sentry.sdk_meta.gen_ai.input.messages.original_length" - """The original length of gen_ai.input.messages before any truncation or modification. + """The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). Type: int Contains PII: false @@ -7568,7 +7568,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): example="7.0.0", ), "sentry.sdk_meta.gen_ai.input.messages.original_length": AttributeMetadata( - brief="The original length of gen_ai.input.messages before any truncation or modification.", + brief="The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s).", type=AttributeType.INTEGER, pii=PiiInfo(isPii=IsPii.FALSE), is_in_otel=False, From d41ac50f84ad7e3abfec5ac2f747fbca05c39dd7 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Mon, 2 Feb 2026 14:38:47 +0100 Subject: [PATCH 6/7] pii maybe --- generated/attributes/sentry.md | 2 +- javascript/sentry-conventions/src/attributes.ts | 4 ++-- ...y__sdk_meta__gen_ai__input__messages__original_length.json | 2 +- python/src/sentry_conventions/attributes.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generated/attributes/sentry.md b/generated/attributes/sentry.md index 590b63c4..5b5c5703 100644 --- a/generated/attributes/sentry.md +++ b/generated/attributes/sentry.md @@ -488,7 +488,7 @@ The original length of gen_ai.input.messages before any truncation or modificati | Property | Value | | --- | --- | | Type | `integer` | -| Has PII | false | +| Has PII | maybe | | Exists in OpenTelemetry | No | | Example | `5` | diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 6612900c..a1f5b3b2 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -7156,7 +7156,7 @@ export type SENTRY_SDK_INTEGRATIONS_TYPE = Array; * * Attribute Value Type: `number` {@link SENTRY_SDK_META_GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_TYPE} * - * Contains PII: false + * Contains PII: maybe * * Attribute defined in OTEL: No * @@ -13282,7 +13282,7 @@ export const ATTRIBUTE_METADATA: Record = { 'The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s).', type: 'integer', pii: { - isPii: 'false', + isPii: 'maybe', }, isInOtel: false, example: 5, diff --git a/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json b/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json index 346da622..cc0f4740 100644 --- a/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json +++ b/model/attributes/sentry/sentry__sdk_meta__gen_ai__input__messages__original_length.json @@ -3,7 +3,7 @@ "brief": "The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s).", "type": "integer", "pii": { - "key": "false" + "key": "maybe" }, "is_in_otel": false, "example": 5 diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 3f969545..3c4faf09 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -4015,7 +4015,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s). Type: int - Contains PII: false + Contains PII: maybe Defined in OTEL: No Example: 5 """ @@ -7570,7 +7570,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "sentry.sdk_meta.gen_ai.input.messages.original_length": AttributeMetadata( brief="The original length of gen_ai.input.messages before any truncation or modification. This refers to the amount of messages in the array, not the length of the message string(s).", type=AttributeType.INTEGER, - pii=PiiInfo(isPii=IsPii.FALSE), + pii=PiiInfo(isPii=IsPii.MAYBE), is_in_otel=False, example=5, ), From e897da122b619370e15cc86add3caf4b08594467 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:36:08 +0100 Subject: [PATCH 7/7] fix --- generated/attributes/all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/attributes/all.md b/generated/attributes/all.md index 60097e13..d5819fe7 100644 --- a/generated/attributes/all.md +++ b/generated/attributes/all.md @@ -4,7 +4,7 @@ This page lists all available attributes across all categories. -Total attributes: 424 +Total attributes: 425 ## Stable Attributes