Skip to content
Merged
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
108 changes: 108 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20760,6 +20760,34 @@ export const USER_ROLES = 'user.roles';
*/
export type USER_ROLES_TYPE = Array<string>;

// 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 <key> being the top-level context property name. `vercel.ai.settings.context.<key>`
*
* 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.<key>';

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

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

/**
Expand Down Expand Up @@ -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 <key> being the top-level context property name. `vercel.ai.tool_call.context.<key>`
*
* 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.<key>';

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

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

/**
Expand Down Expand Up @@ -22561,7 +22617,9 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
'user.ip_address': 'string',
'user.name': 'string',
'user.roles': 'string[]',
'vercel.ai.settings.context.<key>': 'string',
'vercel.ai.telemetry.metadata.<key>': 'string',
'vercel.ai.tool_call.context.<key>': 'string',
'vercel.branch': 'string',
'vercel.build_id': 'string',
'vercel.deployment_id': 'string',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -38996,6 +39056,29 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
example: ['admin', 'editor'],
changelog: [{ version: '0.0.0' }],
},
'vercel.ai.settings.context.<key>': {
brief:
'A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with <key> being the top-level context property name.',
type: 'string',
keys: ['vercel.ai.settings.context.<key>'],
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.<key> 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.<key>`.",
'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.<key>': {
brief:
'Metadata passed to a Vercel AI SDK call through `experimental_telemetry.metadata`, with <key> being the metadata key name.',
Expand All @@ -39018,6 +39101,29 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
'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.<key>': {
brief:
'A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with <key> being the top-level context property name.',
type: 'string',
keys: ['vercel.ai.tool_call.context.<key>'],
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.<key> 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',
Expand Down Expand Up @@ -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;
Expand Down
26 changes: 26 additions & 0 deletions javascript/sentry-conventions/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>`
*/
export const SEARCH_VERCEL__AI__SETTINGS__CONTEXT__KEY = 'vercel.ai.settings.context.<key>';

/**
* 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_AI_TOOL_CALL_CONTEXT_KEY}. `vercel.ai.tool_call.context.<key>`
*/
export const SEARCH_VERCEL__AI__TOOL_CALL__CONTEXT__KEY = 'vercel.ai.tool_call.context.<key>';

/**
* Search name for {@link attributes.VERCEL_BRANCH}. `vercel.branch`
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -12559,13 +12571,27 @@ 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.settings.context.<key>': {
canonicalName: 'vercel.ai.settings.context.<key>',
type: 'string',
brief:
'A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with <key> being the top-level context property name.',
deprecationChain: ['vercel.ai.settings.context.<key>'],
},
'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.ai.tool_call.context.<key>': {
canonicalName: 'vercel.ai.tool_call.context.<key>',
type: 'string',
brief:
'A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with <key> being the top-level context property name.',
deprecationChain: ['vercel.ai.tool_call.context.<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.settings.context.<key>",
"brief": "A runtime context property of a Vercel AI SDK call that the app included in telemetry through `telemetry.includeRuntimeContext`, with <key> being the top-level context property name.",
Comment thread
isaacs marked this conversation as resolved.
Resolved
"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.<key>`.",
"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.<key> attribute"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"key": "vercel.ai.tool_call.context.<key>",
"brief": "A tool context property of a Vercel AI SDK tool call that the app included in telemetry through `telemetry.includeToolsContext`, with <key> 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.<key> attribute"
}
]
}
Loading
Loading