diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index ff3856ba..2ed2b9a8 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -20760,6 +20760,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 /** @@ -20788,6 +20816,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 /** @@ -22561,7 +22617,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', @@ -23522,7 +23580,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 @@ -38996,6 +39056,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`. 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.', + ], + }, 'vercel.ai.telemetry.metadata.': { brief: 'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.', @@ -39018,6 +39101,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`. 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.', + ], + }, 'vercel.branch': { brief: 'Git branch name for Vercel project', type: 'string', @@ -40388,7 +40494,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 74a02d3e..faad19bb 100644 --- a/javascript/sentry-conventions/src/search.ts +++ b/javascript/sentry-conventions/src/search.ts @@ -5328,11 +5328,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` */ @@ -6456,7 +6466,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 @@ -12559,6 +12571,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', @@ -12566,6 +12585,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..7528bf09 --- /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`. 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." + ], + "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..b671f1f9 --- /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`. 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." + ], + "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 243790b4..34bce411 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -12233,6 +12233,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." @@ -12247,6 +12261,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 @@ -30665,6 +30693,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`. 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.", + ], + ), "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, @@ -30692,6 +30747,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`. 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.", + ], + ), "vercel.branch": AttributeMetadata( brief="Git branch name for Vercel project", type=AttributeType.STRING, @@ -32061,7 +32143,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,