Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
Comment thread
isaacs marked this conversation as resolved.
apply_scrubbing: z.object({
key: z.enum(['auto', 'manual', 'never']),
reason: z.string().optional(),
Expand Down
53 changes: 53 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18658,6 +18658,34 @@ export const USER_ROLES = 'user.roles';
*/
export type USER_ROLES_TYPE = Array<string>;

// Path: model/attributes/vercel/vercel__ai__telemetry__metadata__[key].json

/**
* Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> being the metadata key name. `vercel.ai.telemetry.metadata.<key>`
*
* 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.<key>';

/**
* 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.<key>
*/
export type VERCEL_AI_TELEMETRY_METADATA_KEY_TYPE = string;

// Path: model/attributes/vercel/vercel__branch.json

/**
Expand Down Expand Up @@ -20342,6 +20370,7 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
'user.ip_address': 'string',
'user.name': 'string',
'user.roles': 'string[]',
'vercel.ai.telemetry.metadata.<key>': 'string',
'vercel.branch': 'string',
'vercel.build_id': 'string',
'vercel.deployment_id': 'string',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -34819,6 +34849,28 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
example: ['admin', 'editor'],
changelog: [{ version: '0.0.0' }],
},
'vercel.ai.telemetry.metadata.<key>': {
brief:
'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> being the metadata key name.',
type: 'string',
keys: ['vercel.ai.telemetry.metadata.<key>'],
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.<key> 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.<key>`.",
'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',
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions javascript/sentry-conventions/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>`
*/
export const SEARCH_VERCEL__AI__TELEMETRY__METADATA__KEY = 'vercel.ai.telemetry.metadata.<key>';

/**
* Search name for {@link attributes.VERCEL_BRANCH}. `vercel.branch`
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -11421,6 +11427,13 @@ export const ATTRIBUTE_SEARCH_METADATA: Record<string, AttributeSearchMetadata>
brief: 'Value of the HTTP User-Agent header sent by the client.',
deprecationChain: ['user_agent.original', 'http.user_agent'],
},
'vercel.ai.telemetry.metadata.<key>': {
canonicalName: 'vercel.ai.telemetry.metadata.<key>',
type: 'string',
brief:
'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> being the metadata key name.',
deprecationChain: ['vercel.ai.telemetry.metadata.<key>'],
},
'vercel.branch': {
canonicalName: 'vercel.branch',
type: 'string',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"key": "vercel.ai.telemetry.metadata.<key>",
"brief": "Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> 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.<key>`.",
"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.<key> attribute"
}
]
}
42 changes: 42 additions & 0 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>"] = (
"vercel.ai.telemetry.metadata.<key>"
)
"""Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> 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
Expand Down Expand Up @@ -27244,6 +27258,33 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
ChangelogEntry(version="0.0.0"),
],
),
"vercel.ai.telemetry.metadata.<key>": AttributeMetadata(
brief="Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> being the metadata key name.",
type=AttributeType.STRING,
keys=("vercel.ai.telemetry.metadata.<key>",),
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.<key> 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.<key>`.",
"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,
Expand Down Expand Up @@ -28524,6 +28565,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
"user.name": str,
"user.roles": List[str],
"user_agent.original": str,
"vercel.ai.telemetry.metadata.<key>": str,
"vercel.branch": str,
"vercel.build_id": str,
"vercel.deployment_id": str,
Expand Down
Loading