diff --git a/docs/src/content.config.ts b/docs/src/content.config.ts index b02ef3aa3..00162ac3e 100644 --- a/docs/src/content.config.ts +++ b/docs/src/content.config.ts @@ -17,7 +17,7 @@ const attributeSchema = z key: z.string(), brief: z.string(), has_dynamic_suffix: z.boolean().optional(), - type: z.enum(['string', 'boolean', 'integer', 'double', 'string[]', 'boolean[]', 'integer[]', 'double[]']), + type: z.enum(['string', 'boolean', 'integer', 'double', 'string[]', 'boolean[]', 'integer[]', 'double[]', 'any']), apply_scrubbing: z.object({ key: z.enum(['auto', 'manual', 'never']), reason: z.string().optional(), diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 383bb4b36..74117834b 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -18658,6 +18658,34 @@ export const USER_ROLES = 'user.roles'; */ export type USER_ROLES_TYPE = Array; +// Path: model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json + +/** + * Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name. `vercel.ai.telemetry.metadata.` + * + * Attribute Value Type: `string` {@link VERCEL_AI_TELEMETRY_METADATA_KEY_TYPE} + * + * Apply Scrubbing: auto - Metadata is user-defined and can contain user data + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Has Dynamic Suffix: true + * + * @example "vercel.ai.telemetry.metadata.tenantId='acme'" + */ +export const VERCEL_AI_TELEMETRY_METADATA_KEY = 'vercel.ai.telemetry.metadata.'; + +/** + * Base key for {@link VERCEL_AI_TELEMETRY_METADATA_KEY}. Use with a dynamic suffix, e.g. `${VERCEL_AI_TELEMETRY_METADATA_KEY_BASE}.${key}`. + */ +export const VERCEL_AI_TELEMETRY_METADATA_KEY_BASE = 'vercel.ai.telemetry.metadata'; + +/** + * Type for {@link VERCEL_AI_TELEMETRY_METADATA_KEY} vercel.ai.telemetry.metadata. + */ +export type VERCEL_AI_TELEMETRY_METADATA_KEY_TYPE = string; + // Path: model/attributes/vercel/vercel__branch.json /** @@ -20342,6 +20370,7 @@ export const ATTRIBUTE_TYPE: Record = { 'user.ip_address': 'string', 'user.name': 'string', 'user.roles': 'string[]', + 'vercel.ai.telemetry.metadata.': 'string', 'vercel.branch': 'string', 'vercel.build_id': 'string', 'vercel.deployment_id': 'string', @@ -21213,6 +21242,7 @@ export type AttributeName = | typeof USER_IP_ADDRESS | typeof USER_NAME | typeof USER_ROLES + | typeof VERCEL_AI_TELEMETRY_METADATA_KEY | typeof VERCEL_BRANCH | typeof VERCEL_BUILD_ID | typeof VERCEL_DEPLOYMENT_ID @@ -34819,6 +34849,28 @@ export const ATTRIBUTE_METADATA: Record = { example: ['admin', 'editor'], changelog: [{ version: '0.0.0' }], }, + 'vercel.ai.telemetry.metadata.': { + brief: + 'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.', + type: 'string', + keys: ['vercel.ai.telemetry.metadata.'], + applyScrubbing: { + key: 'auto', + reason: 'Metadata is user-defined and can contain user data', + }, + isInOtel: false, + visibility: 'public', + hasDynamicSuffix: true, + example: "vercel.ai.telemetry.metadata.tenantId='acme'", + examples: ["vercel.ai.telemetry.metadata.tenantId='acme'"], + changelog: [{ version: 'next', prs: [662], description: 'Added vercel.ai.telemetry.metadata. attribute' }], + additionalContext: [ + 'Set on `gen_ai` spans for `invoke_agent`, `generate_content` and `embeddings` operations. Not set on `execute_tool` spans.', + "The Vercel AI SDK's own OpenTelemetry spans emit the same data as `ai.telemetry.metadata.`.", + 'The Vercel AI SDK also allows numbers, booleans and arrays as metadata values. SDKs MUST convert these values to strings.', + '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.branch': { brief: 'Git branch name for Vercel project', type: 'string', @@ -36100,6 +36152,7 @@ export type Attributes = { [USER_IP_ADDRESS]?: USER_IP_ADDRESS_TYPE; [USER_NAME]?: USER_NAME_TYPE; [USER_ROLES]?: USER_ROLES_TYPE; + [VERCEL_AI_TELEMETRY_METADATA_KEY]?: VERCEL_AI_TELEMETRY_METADATA_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 e9ef2e9bb..85994ff17 100644 --- a/javascript/sentry-conventions/src/search.ts +++ b/javascript/sentry-conventions/src/search.ts @@ -4850,6 +4850,11 @@ export const SEARCH_USER__USERNAME = 'user.username'; */ export const SEARCH_USER_AGENT__ORIGINAL = 'user_agent.original'; +/** + * 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_BRANCH}. `vercel.branch` */ @@ -5884,6 +5889,7 @@ export type AttributeSearchName = | typeof SEARCH_USER__ROLES | typeof SEARCH_USER__USERNAME | typeof SEARCH_USER_AGENT__ORIGINAL + | typeof SEARCH_VERCEL__AI__TELEMETRY__METADATA__KEY | typeof SEARCH_VERCEL__BRANCH | typeof SEARCH_VERCEL__BUILD_ID | typeof SEARCH_VERCEL__DEPLOYMENT_ID @@ -11421,6 +11427,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.telemetry.metadata.': { + canonicalName: 'vercel.ai.telemetry.metadata.', + type: 'string', + brief: + 'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.', + deprecationChain: ['vercel.ai.telemetry.metadata.'], + }, 'vercel.branch': { canonicalName: 'vercel.branch', type: 'string', diff --git a/model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json b/model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json new file mode 100644 index 000000000..55013f0a5 --- /dev/null +++ b/model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json @@ -0,0 +1,26 @@ +{ + "key": "vercel.ai.telemetry.metadata.", + "brief": "Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name.", + "has_dynamic_suffix": true, + "type": "string", + "apply_scrubbing": { + "key": "auto", + "reason": "Metadata is user-defined and can contain user data" + }, + "additional_context": [ + "Set on `gen_ai` spans for `invoke_agent`, `generate_content` and `embeddings` operations. Not set on `execute_tool` spans.", + "The Vercel AI SDK's own OpenTelemetry spans emit the same data as `ai.telemetry.metadata.`.", + "The Vercel AI SDK also allows numbers, booleans and arrays as metadata values. SDKs MUST convert these values to strings.", + "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." + ], + "is_in_otel": false, + "visibility": "public", + "examples": ["vercel.ai.telemetry.metadata.tenantId='acme'"], + "changelog": [ + { + "version": "next", + "prs": [662], + "description": "Added vercel.ai.telemetry.metadata. attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 84dd5c22f..f2a2733d3 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -10898,6 +10898,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__telemetry__metadata__[key].json + VERCEL_AI_TELEMETRY_METADATA_KEY: Literal["vercel.ai.telemetry.metadata."] = ( + "vercel.ai.telemetry.metadata." + ) + """Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with being the metadata key name. + + Type: str + Apply Scrubbing: auto - Metadata is user-defined and can contain user data + Defined in OTEL: No + Visibility: public + Has Dynamic Suffix: true + Example: "vercel.ai.telemetry.metadata.tenantId='acme'" + """ + # Path: model/attributes/vercel/vercel__branch.json VERCEL_BRANCH: Literal["vercel.branch"] = "vercel.branch" """Git branch name for Vercel project @@ -27244,6 +27258,33 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), + "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, + keys=("vercel.ai.telemetry.metadata.",), + apply_scrubbing=ApplyScrubbingInfo( + key=ApplyScrubbing.AUTO, + reason="Metadata is user-defined and can contain user data", + ), + is_in_otel=False, + visibility=Visibility.PUBLIC, + has_dynamic_suffix=True, + example="vercel.ai.telemetry.metadata.tenantId='acme'", + examples=["vercel.ai.telemetry.metadata.tenantId='acme'"], + changelog=[ + ChangelogEntry( + version="next", + prs=[662], + description="Added vercel.ai.telemetry.metadata. attribute", + ), + ], + additional_context=[ + "Set on `gen_ai` spans for `invoke_agent`, `generate_content` and `embeddings` operations. Not set on `execute_tool` spans.", + "The Vercel AI SDK's own OpenTelemetry spans emit the same data as `ai.telemetry.metadata.`.", + "The Vercel AI SDK also allows numbers, booleans and arrays as metadata values. SDKs MUST convert these values to strings.", + "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.branch": AttributeMetadata( brief="Git branch name for Vercel project", type=AttributeType.STRING, @@ -28524,6 +28565,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "user.name": str, "user.roles": List[str], "user_agent.original": str, + "vercel.ai.telemetry.metadata.": str, "vercel.branch": str, "vercel.build_id": str, "vercel.deployment_id": str,