From 85164b97139f696ecb2fbb427b96460763d7a5df Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 28 Oct 2026 16:07:12 -0700 Subject: [PATCH 1/2] feat(attributes): Add Vercel AI runtime and tool context attributes Add `vercel.ai.settings.context.` and `vercel.ai.tool_call.context.`. `ai` 7 removed `telemetry.metadata`. Per-call metadata now goes in `runtimeContext` and `toolsContext`. The app opts keys into telemetry with `telemetry.includeRuntimeContext` and `telemetry.includeToolsContext`. The Vercel AI integration in sentry-javascript records the included keys on gen_ai spans (getsentry/sentry-javascript#25774). The runtime context name matches `@ai-sdk/otel`, which emits `ai.settings.context.`, under the usual `ai.*` to `vercel.ai.*` renaming. `@ai-sdk/otel` does not record tool context, so the tool context name uses snake_case for its fixed segments. The type is `string`, as for `vercel.ai.telemetry.metadata.`. Context values can have any type, so SDKs convert them to strings. `ai` versions before 7.0.114 publish the full context on the `ai:telemetry` channel and ignore the include lists. The attributes tell SDKs to read context only from events that carry `aiVersion` (added in `ai` 7.0.154), so keys the app did not opt in are not sent. Related: https://github.com/getsentry/sentry-javascript/issues/24706 Co-Authored-By: Claude Opus 5.5 (1M context) --- .../sentry-conventions/src/attributes.ts | 108 ++++++++++++++++++ javascript/sentry-conventions/src/search.ts | 26 +++++ .../vercel__ai__settings__context__[key].json | 26 +++++ ...vercel__ai__tool_call__context__[key].json | 26 +++++ python/src/sentry_conventions/attributes.py | 84 ++++++++++++++ 5 files changed, 270 insertions(+) create mode 100644 model/attributes/vercel/vercel__ai__settings__context__[key].json create mode 100644 model/attributes/vercel/vercel__ai__tool_call__context__[key].json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 0bae7a7e..041efef9 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -20526,6 +20526,34 @@ export const USER_ROLES = 'user.roles'; */ export type USER_ROLES_TYPE = Array; +// Path: model/attributes/vercel/vercel__ai__settings__context__[key].json + +/** + * A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with being the top-level context property name. `vercel.ai.settings.context.` + * + * Attribute Value Type: `string` {@link VERCEL_AI_SETTINGS_CONTEXT_KEY_TYPE} + * + * Apply Scrubbing: auto - Runtime context is user-defined and can contain user data + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Has Dynamic Suffix: true + * + * @example "vercel.ai.settings.context.tenantId='acme'" + */ +export const VERCEL_AI_SETTINGS_CONTEXT_KEY = 'vercel.ai.settings.context.'; + +/** + * Base key for {@link VERCEL_AI_SETTINGS_CONTEXT_KEY}. Use with a dynamic suffix, e.g. `${VERCEL_AI_SETTINGS_CONTEXT_KEY_BASE}.${key}`. + */ +export const VERCEL_AI_SETTINGS_CONTEXT_KEY_BASE = 'vercel.ai.settings.context'; + +/** + * Type for {@link VERCEL_AI_SETTINGS_CONTEXT_KEY} vercel.ai.settings.context. + */ +export type VERCEL_AI_SETTINGS_CONTEXT_KEY_TYPE = string; + // Path: model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json /** @@ -20554,6 +20582,34 @@ export const VERCEL_AI_TELEMETRY_METADATA_KEY_BASE = 'vercel.ai.telemetry.metada */ export type VERCEL_AI_TELEMETRY_METADATA_KEY_TYPE = string; +// Path: model/attributes/vercel/vercel__ai__tool_call__context__[key].json + +/** + * A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with being the top-level context property name. `vercel.ai.tool_call.context.` + * + * Attribute Value Type: `string` {@link VERCEL_AI_TOOL_CALL_CONTEXT_KEY_TYPE} + * + * Apply Scrubbing: auto - Tool context is user-defined and can contain user data + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Has Dynamic Suffix: true + * + * @example "vercel.ai.tool_call.context.units='metric'" + */ +export const VERCEL_AI_TOOL_CALL_CONTEXT_KEY = 'vercel.ai.tool_call.context.'; + +/** + * Base key for {@link VERCEL_AI_TOOL_CALL_CONTEXT_KEY}. Use with a dynamic suffix, e.g. `${VERCEL_AI_TOOL_CALL_CONTEXT_KEY_BASE}.${key}`. + */ +export const VERCEL_AI_TOOL_CALL_CONTEXT_KEY_BASE = 'vercel.ai.tool_call.context'; + +/** + * Type for {@link VERCEL_AI_TOOL_CALL_CONTEXT_KEY} vercel.ai.tool_call.context. + */ +export type VERCEL_AI_TOOL_CALL_CONTEXT_KEY_TYPE = string; + // Path: model/attributes/vercel/vercel__branch.json /** @@ -22319,7 +22375,9 @@ export const ATTRIBUTE_TYPE: Record = { 'user.ip_address': 'string', 'user.name': 'string', 'user.roles': 'string[]', + 'vercel.ai.settings.context.': 'string', 'vercel.ai.telemetry.metadata.': 'string', + 'vercel.ai.tool_call.context.': 'string', 'vercel.branch': 'string', 'vercel.build_id': 'string', 'vercel.deployment_id': 'string', @@ -23272,7 +23330,9 @@ export type AttributeName = | typeof USER_IP_ADDRESS | typeof USER_NAME | typeof USER_ROLES + | typeof VERCEL_AI_SETTINGS_CONTEXT_KEY | typeof VERCEL_AI_TELEMETRY_METADATA_KEY + | typeof VERCEL_AI_TOOL_CALL_CONTEXT_KEY | typeof VERCEL_BRANCH | typeof VERCEL_BUILD_ID | typeof VERCEL_DEPLOYMENT_ID @@ -38613,6 +38673,29 @@ export const ATTRIBUTE_METADATA: Record = { example: ['admin', 'editor'], changelog: [{ version: '0.0.0' }], }, + 'vercel.ai.settings.context.': { + brief: + 'A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with being the top-level context property name.', + type: 'string', + keys: ['vercel.ai.settings.context.'], + applyScrubbing: { + key: 'auto', + reason: 'Runtime context is user-defined and can contain user data', + }, + isInOtel: false, + visibility: 'public', + hasDynamicSuffix: true, + example: "vercel.ai.settings.context.tenantId='acme'", + examples: ["vercel.ai.settings.context.tenantId='acme'"], + changelog: [{ version: 'next', description: 'Added vercel.ai.settings.context. attribute' }], + additionalContext: [ + 'Set on `gen_ai` spans for `invoke_agent`, `generate_content`, `execute_tool`, `embeddings`, `rerank` and `decide` operations. Spans for model calls and tool calls inside an operation copy the attributes of that operation.', + 'SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. `ai` versions before 7.0.114 publish the full runtime context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record runtime context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.', + "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) emits the same data as `ai.settings.context.`.", + 'Runtime context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.', + 'This attribute is open-ended on purpose. The Vercel AI SDK does not define the runtime context keys.', + ], + }, 'vercel.ai.telemetry.metadata.': { brief: 'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.', @@ -38635,6 +38718,29 @@ export const ATTRIBUTE_METADATA: Record = { 'This attribute is open-ended on purpose. The Vercel AI SDK does not define the metadata keys. If Vercel defines a stricter spec for this metadata, consider moving it into `gen_ai.*` attributes.', ], }, + 'vercel.ai.tool_call.context.': { + brief: + 'A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with being the top-level context property name.', + type: 'string', + keys: ['vercel.ai.tool_call.context.'], + applyScrubbing: { + key: 'auto', + reason: 'Tool context is user-defined and can contain user data', + }, + isInOtel: false, + visibility: 'public', + hasDynamicSuffix: true, + example: "vercel.ai.tool_call.context.units='metric'", + examples: ["vercel.ai.tool_call.context.units='metric'"], + changelog: [{ version: 'next', description: 'Added vercel.ai.tool_call.context. attribute' }], + additionalContext: [ + 'Set on `gen_ai` spans for `execute_tool` operations.', + 'SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. `ai` versions before 7.0.114 publish the full tool context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record tool context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.', + "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) does not record tool context.", + 'Tool context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.', + 'This attribute is open-ended on purpose. The Vercel AI SDK does not define the tool context keys.', + ], + }, 'vercel.branch': { brief: 'Git branch name for Vercel project', type: 'string', @@ -39997,7 +40103,9 @@ export type Attributes = { [USER_IP_ADDRESS]?: USER_IP_ADDRESS_TYPE; [USER_NAME]?: USER_NAME_TYPE; [USER_ROLES]?: USER_ROLES_TYPE; + [VERCEL_AI_SETTINGS_CONTEXT_KEY]?: VERCEL_AI_SETTINGS_CONTEXT_KEY_TYPE; [VERCEL_AI_TELEMETRY_METADATA_KEY]?: VERCEL_AI_TELEMETRY_METADATA_KEY_TYPE; + [VERCEL_AI_TOOL_CALL_CONTEXT_KEY]?: VERCEL_AI_TOOL_CALL_CONTEXT_KEY_TYPE; [VERCEL_BRANCH]?: VERCEL_BRANCH_TYPE; [VERCEL_BUILD_ID]?: VERCEL_BUILD_ID_TYPE; [VERCEL_DEPLOYMENT_ID]?: VERCEL_DEPLOYMENT_ID_TYPE; diff --git a/javascript/sentry-conventions/src/search.ts b/javascript/sentry-conventions/src/search.ts index 3243a208..c5865950 100644 --- a/javascript/sentry-conventions/src/search.ts +++ b/javascript/sentry-conventions/src/search.ts @@ -5293,11 +5293,21 @@ export const SEARCH_USER__USERNAME = 'user.username'; */ export const SEARCH_USER_AGENT__ORIGINAL = 'user_agent.original'; +/** + * Search name for {@link attributes.VERCEL_AI_SETTINGS_CONTEXT_KEY}. `vercel.ai.settings.context.` + */ +export const SEARCH_VERCEL__AI__SETTINGS__CONTEXT__KEY = 'vercel.ai.settings.context.'; + /** * Search name for {@link attributes.VERCEL_AI_TELEMETRY_METADATA_KEY}. `vercel.ai.telemetry.metadata.` */ export const SEARCH_VERCEL__AI__TELEMETRY__METADATA__KEY = 'vercel.ai.telemetry.metadata.'; +/** + * Search name for {@link attributes.VERCEL_AI_TOOL_CALL_CONTEXT_KEY}. `vercel.ai.tool_call.context.` + */ +export const SEARCH_VERCEL__AI__TOOL_CALL__CONTEXT__KEY = 'vercel.ai.tool_call.context.'; + /** * Search name for {@link attributes.VERCEL_BRANCH}. `vercel.branch` */ @@ -6414,7 +6424,9 @@ export type AttributeSearchName = | typeof SEARCH_USER__ROLES | typeof SEARCH_USER__USERNAME | typeof SEARCH_USER_AGENT__ORIGINAL + | typeof SEARCH_VERCEL__AI__SETTINGS__CONTEXT__KEY | typeof SEARCH_VERCEL__AI__TELEMETRY__METADATA__KEY + | typeof SEARCH_VERCEL__AI__TOOL_CALL__CONTEXT__KEY | typeof SEARCH_VERCEL__BRANCH | typeof SEARCH_VERCEL__BUILD_ID | typeof SEARCH_VERCEL__DEPLOYMENT_ID @@ -12470,6 +12482,13 @@ export const ATTRIBUTE_SEARCH_METADATA: Record brief: 'Value of the HTTP User-Agent header sent by the client.', deprecationChain: ['user_agent.original', 'http.user_agent'], }, + 'vercel.ai.settings.context.': { + canonicalName: 'vercel.ai.settings.context.', + type: 'string', + brief: + 'A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with being the top-level context property name.', + deprecationChain: ['vercel.ai.settings.context.'], + }, 'vercel.ai.telemetry.metadata.': { canonicalName: 'vercel.ai.telemetry.metadata.', type: 'string', @@ -12477,6 +12496,13 @@ export const ATTRIBUTE_SEARCH_METADATA: Record 'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.', deprecationChain: ['vercel.ai.telemetry.metadata.'], }, + 'vercel.ai.tool_call.context.': { + canonicalName: 'vercel.ai.tool_call.context.', + type: 'string', + brief: + 'A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with being the top-level context property name.', + deprecationChain: ['vercel.ai.tool_call.context.'], + }, 'vercel.branch': { canonicalName: 'vercel.branch', type: 'string', diff --git a/model/attributes/vercel/vercel__ai__settings__context__[key].json b/model/attributes/vercel/vercel__ai__settings__context__[key].json new file mode 100644 index 00000000..3f85ec69 --- /dev/null +++ b/model/attributes/vercel/vercel__ai__settings__context__[key].json @@ -0,0 +1,26 @@ +{ + "key": "vercel.ai.settings.context.", + "brief": "A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with being the top-level context property name.", + "has_dynamic_suffix": true, + "type": "string", + "apply_scrubbing": { + "key": "auto", + "reason": "Runtime context is user-defined and can contain user data" + }, + "additional_context": [ + "Set on `gen_ai` spans for `invoke_agent`, `generate_content`, `execute_tool`, `embeddings`, `rerank` and `decide` operations. Spans for model calls and tool calls inside an operation copy the attributes of that operation.", + "SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. `ai` versions before 7.0.114 publish the full runtime context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record runtime context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) emits the same data as `ai.settings.context.`.", + "Runtime context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", + "This attribute is open-ended on purpose. The Vercel AI SDK does not define the runtime context keys." + ], + "is_in_otel": false, + "visibility": "public", + "examples": ["vercel.ai.settings.context.tenantId='acme'"], + "changelog": [ + { + "version": "next", + "description": "Added vercel.ai.settings.context. attribute" + } + ] +} diff --git a/model/attributes/vercel/vercel__ai__tool_call__context__[key].json b/model/attributes/vercel/vercel__ai__tool_call__context__[key].json new file mode 100644 index 00000000..495f1c53 --- /dev/null +++ b/model/attributes/vercel/vercel__ai__tool_call__context__[key].json @@ -0,0 +1,26 @@ +{ + "key": "vercel.ai.tool_call.context.", + "brief": "A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with being the top-level context property name.", + "has_dynamic_suffix": true, + "type": "string", + "apply_scrubbing": { + "key": "auto", + "reason": "Tool context is user-defined and can contain user data" + }, + "additional_context": [ + "Set on `gen_ai` spans for `execute_tool` operations.", + "SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. `ai` versions before 7.0.114 publish the full tool context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record tool context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) does not record tool context.", + "Tool context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", + "This attribute is open-ended on purpose. The Vercel AI SDK does not define the tool context keys." + ], + "is_in_otel": false, + "visibility": "public", + "examples": ["vercel.ai.tool_call.context.units='metric'"], + "changelog": [ + { + "version": "next", + "description": "Added vercel.ai.tool_call.context. attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index a70dad54..2282cfd2 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -12075,6 +12075,20 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1" """ + # Path: model/attributes/vercel/vercel__ai__settings__context__[key].json + VERCEL_AI_SETTINGS_CONTEXT_KEY: Literal["vercel.ai.settings.context."] = ( + "vercel.ai.settings.context." + ) + """A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with being the top-level context property name. + + Type: str + Apply Scrubbing: auto - Runtime context is user-defined and can contain user data + Defined in OTEL: No + Visibility: public + Has Dynamic Suffix: true + Example: "vercel.ai.settings.context.tenantId='acme'" + """ + # Path: model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json VERCEL_AI_TELEMETRY_METADATA_KEY: Literal["vercel.ai.telemetry.metadata."] = ( "vercel.ai.telemetry.metadata." @@ -12089,6 +12103,20 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "vercel.ai.telemetry.metadata.tenantId='acme'" """ + # Path: model/attributes/vercel/vercel__ai__tool_call__context__[key].json + VERCEL_AI_TOOL_CALL_CONTEXT_KEY: Literal["vercel.ai.tool_call.context."] = ( + "vercel.ai.tool_call.context." + ) + """A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with being the top-level context property name. + + Type: str + Apply Scrubbing: auto - Tool context is user-defined and can contain user data + Defined in OTEL: No + Visibility: public + Has Dynamic Suffix: true + Example: "vercel.ai.tool_call.context.units='metric'" + """ + # Path: model/attributes/vercel/vercel__branch.json VERCEL_BRANCH: Literal["vercel.branch"] = "vercel.branch" """Git branch name for Vercel project @@ -30357,6 +30385,33 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), + "vercel.ai.settings.context.": AttributeMetadata( + brief="A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with being the top-level context property name.", + type=AttributeType.STRING, + keys=("vercel.ai.settings.context.",), + apply_scrubbing=ApplyScrubbingInfo( + key=ApplyScrubbing.AUTO, + reason="Runtime context is user-defined and can contain user data", + ), + is_in_otel=False, + visibility=Visibility.PUBLIC, + has_dynamic_suffix=True, + example="vercel.ai.settings.context.tenantId='acme'", + examples=["vercel.ai.settings.context.tenantId='acme'"], + changelog=[ + ChangelogEntry( + version="next", + description="Added vercel.ai.settings.context. attribute", + ), + ], + additional_context=[ + "Set on `gen_ai` spans for `invoke_agent`, `generate_content`, `execute_tool`, `embeddings`, `rerank` and `decide` operations. Spans for model calls and tool calls inside an operation copy the attributes of that operation.", + "SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. `ai` versions before 7.0.114 publish the full runtime context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record runtime context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) emits the same data as `ai.settings.context.`.", + "Runtime context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", + "This attribute is open-ended on purpose. The Vercel AI SDK does not define the runtime context keys.", + ], + ), "vercel.ai.telemetry.metadata.": AttributeMetadata( brief="Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.", type=AttributeType.STRING, @@ -30384,6 +30439,33 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "This attribute is open-ended on purpose. The Vercel AI SDK does not define the metadata keys. If Vercel defines a stricter spec for this metadata, consider moving it into `gen_ai.*` attributes.", ], ), + "vercel.ai.tool_call.context.": AttributeMetadata( + brief="A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with being the top-level context property name.", + type=AttributeType.STRING, + keys=("vercel.ai.tool_call.context.",), + apply_scrubbing=ApplyScrubbingInfo( + key=ApplyScrubbing.AUTO, + reason="Tool context is user-defined and can contain user data", + ), + is_in_otel=False, + visibility=Visibility.PUBLIC, + has_dynamic_suffix=True, + example="vercel.ai.tool_call.context.units='metric'", + examples=["vercel.ai.tool_call.context.units='metric'"], + changelog=[ + ChangelogEntry( + version="next", + description="Added vercel.ai.tool_call.context. attribute", + ), + ], + additional_context=[ + "Set on `gen_ai` spans for `execute_tool` operations.", + "SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. `ai` versions before 7.0.114 publish the full tool context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record tool context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) does not record tool context.", + "Tool context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", + "This attribute is open-ended on purpose. The Vercel AI SDK does not define the tool context keys.", + ], + ), "vercel.branch": AttributeMetadata( brief="Git branch name for Vercel project", type=AttributeType.STRING, @@ -31745,7 +31827,9 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "user.name": str, "user.roles": List[str], "user_agent.original": str, + "vercel.ai.settings.context.": str, "vercel.ai.telemetry.metadata.": str, + "vercel.ai.tool_call.context.": str, "vercel.branch": str, "vercel.build_id": str, "vercel.deployment_id": str, From 6a54e3bccb3420f92a88285e3c07f7984d416311 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 29 Oct 2026 08:50:55 -0700 Subject: [PATCH 2/2] fix: remove js-specific language from vercel-ai runtimeContext fields --- javascript/sentry-conventions/src/attributes.ts | 4 ++-- .../vercel/vercel__ai__settings__context__[key].json | 2 +- .../vercel/vercel__ai__tool_call__context__[key].json | 2 +- python/src/sentry_conventions/attributes.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 041efef9..e95568f7 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -38690,7 +38690,7 @@ export const ATTRIBUTE_METADATA: Record = { changelog: [{ version: 'next', description: 'Added vercel.ai.settings.context. attribute' }], additionalContext: [ 'Set on `gen_ai` spans for `invoke_agent`, `generate_content`, `execute_tool`, `embeddings`, `rerank` and `decide` operations. Spans for model calls and tool calls inside an operation copy the attributes of that operation.', - 'SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. `ai` versions before 7.0.114 publish the full runtime context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record runtime context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.', + 'SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. Some Vercel AI SDK versions expose the full runtime context to instrumentation. If an SDK cannot confirm that the Vercel AI SDK filtered the runtime context, it MUST NOT record it.', "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) emits the same data as `ai.settings.context.`.", 'Runtime context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.', 'This attribute is open-ended on purpose. The Vercel AI SDK does not define the runtime context keys.', @@ -38735,7 +38735,7 @@ export const ATTRIBUTE_METADATA: Record = { changelog: [{ version: 'next', description: 'Added vercel.ai.tool_call.context. attribute' }], additionalContext: [ 'Set on `gen_ai` spans for `execute_tool` operations.', - 'SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. `ai` versions before 7.0.114 publish the full tool context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record tool context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.', + 'SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. Some Vercel AI SDK versions expose the full tool context to instrumentation. If an SDK cannot confirm that the Vercel AI SDK filtered the tool context, it MUST NOT record it.', "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) does not record tool context.", 'Tool context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.', 'This attribute is open-ended on purpose. The Vercel AI SDK does not define the tool context keys.', diff --git a/model/attributes/vercel/vercel__ai__settings__context__[key].json b/model/attributes/vercel/vercel__ai__settings__context__[key].json index 3f85ec69..7528bf09 100644 --- a/model/attributes/vercel/vercel__ai__settings__context__[key].json +++ b/model/attributes/vercel/vercel__ai__settings__context__[key].json @@ -9,7 +9,7 @@ }, "additional_context": [ "Set on `gen_ai` spans for `invoke_agent`, `generate_content`, `execute_tool`, `embeddings`, `rerank` and `decide` operations. Spans for model calls and tool calls inside an operation copy the attributes of that operation.", - "SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. `ai` versions before 7.0.114 publish the full runtime context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record runtime context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. Some Vercel AI SDK versions expose the full runtime context to instrumentation. If an SDK cannot confirm that the Vercel AI SDK filtered the runtime context, it MUST NOT record it.", "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) emits the same data as `ai.settings.context.`.", "Runtime context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", "This attribute is open-ended on purpose. The Vercel AI SDK does not define the runtime context keys." diff --git a/model/attributes/vercel/vercel__ai__tool_call__context__[key].json b/model/attributes/vercel/vercel__ai__tool_call__context__[key].json index 495f1c53..b671f1f9 100644 --- a/model/attributes/vercel/vercel__ai__tool_call__context__[key].json +++ b/model/attributes/vercel/vercel__ai__tool_call__context__[key].json @@ -9,7 +9,7 @@ }, "additional_context": [ "Set on `gen_ai` spans for `execute_tool` operations.", - "SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. `ai` versions before 7.0.114 publish the full tool context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record tool context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. Some Vercel AI SDK versions expose the full tool context to instrumentation. If an SDK cannot confirm that the Vercel AI SDK filtered the tool context, it MUST NOT record it.", "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) does not record tool context.", "Tool context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", "This attribute is open-ended on purpose. The Vercel AI SDK does not define the tool context keys." diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 2282cfd2..ddc72e01 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -30406,7 +30406,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ], additional_context=[ "Set on `gen_ai` spans for `invoke_agent`, `generate_content`, `execute_tool`, `embeddings`, `rerank` and `decide` operations. Spans for model calls and tool calls inside an operation copy the attributes of that operation.", - "SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. `ai` versions before 7.0.114 publish the full runtime context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record runtime context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "SDKs MUST only record the properties that the app included through `telemetry.includeRuntimeContext`. Some Vercel AI SDK versions expose the full runtime context to instrumentation. If an SDK cannot confirm that the Vercel AI SDK filtered the runtime context, it MUST NOT record it.", "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) emits the same data as `ai.settings.context.`.", "Runtime context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", "This attribute is open-ended on purpose. The Vercel AI SDK does not define the runtime context keys.", @@ -30460,7 +30460,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ], additional_context=[ "Set on `gen_ai` spans for `execute_tool` operations.", - "SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. `ai` versions before 7.0.114 publish the full tool context on the `ai:telemetry` diagnostics channel. SDKs MUST NOT record tool context from channel events that do not have the `aiVersion` field, which `ai` added in 7.0.154.", + "SDKs MUST only record the properties that the app included for the tool through `telemetry.includeToolsContext`. Some Vercel AI SDK versions expose the full tool context to instrumentation. If an SDK cannot confirm that the Vercel AI SDK filtered the tool context, it MUST NOT record it.", "The Vercel AI SDK's own OpenTelemetry integration (`@ai-sdk/otel`) does not record tool context.", "Tool context values can have any type. SDKs MUST convert them to strings, and SHOULD serialize objects and arrays as JSON.", "This attribute is open-ended on purpose. The Vercel AI SDK does not define the tool context keys.",