Repository navigation
Conversation
…el AI spans On `ai` 7 the `telemetry.metadata` option is gone. Per-call metadata goes in `runtimeContext`, and the app opts keys into telemetry with `telemetry.includeRuntimeContext` (and `includeToolsContext` for tool context). The channel subscriber did not read either field, so there was no way to put request-level data on gen_ai spans. The subscriber now records each included `runtimeContext` key as `vercel.ai.settings.context.<key>` on the operation span and on its `generate_content` and `execute_tool` child spans. It records each included `toolContext` key as `vercel.ai.toolCall.context.<key>` on the `execute_tool` span. The `runtimeContext` names match `@ai-sdk/otel` (`ai.settings.context.*`) under the usual `ai.*` to `vercel.ai.*` renaming. `ai` before 7.0.114 published the full context to the channel and ignored the include lists. A filtered context looks the same as an unfiltered one, so the subscriber only reads context from events that carry `aiVersion`, which `ai` added in 7.0.154. Older 7.x versions record no context, so keys the app did not opt in never leave it. Fixes #24706 Fixes JS-3788 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
size-limit report 📦Compared: 8594b78 (PR test merge using develop at b722d3c) Against: b722d3c (develop) · base run #64026 ✅ Baseline matches: this diff contains only this PR's changes.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7dcc279. Configure here.
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 66 successful. See the run.
Successful checks
|
andreiborza
left a comment
There was a problem hiding this comment.
LGTM just one casing change request and adding these to conventions 🙏
| @@ -86,6 +86,8 @@ const VERCEL_AI_OPERATION_ID_ATTRIBUTE = 'vercel.ai.operationId'; | |||
| const VERCEL_AI_MODEL_PROVIDER_ATTRIBUTE = 'vercel.ai.model.provider'; | |||
| const VERCEL_AI_SETTINGS_MAX_RETRIES_ATTRIBUTE = 'vercel.ai.settings.maxRetries'; | |||
| const VERCEL_AI_TELEMETRY_METADATA_ATTRIBUTE_PREFIX = 'vercel.ai.telemetry.metadata.'; | |||
| const VERCEL_AI_SETTINGS_CONTEXT_ATTRIBUTE_PREFIX = 'vercel.ai.settings.context.'; | |||
| const VERCEL_AI_TOOL_CALL_CONTEXT_ATTRIBUTE_PREFIX = 'vercel.ai.toolCall.context.'; | |||
There was a problem hiding this comment.
Could you please add these all to https://github.com/getsentry/sentry-conventions? We are missing all of them.
There was a problem hiding this comment.
Ideally, before we merge this PR please, in case we need to change them.
There was a problem hiding this comment.
Removing the approval so we don't accidentally merge this before sentry conventions are in.
Rename `vercel.ai.toolCall.context.<key>` to `vercel.ai.tool_call.context.<key>`, because fixed segments in Sentry conventions use snake_case. Record every context value as a string, to match the `string` type of both attributes in sentry-conventions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@andreiborza I added a PR to sentry-conventions for the fields being added here, but there are a few others in that file from 3bfeb64 which are also not tracked in sentry-conventions. I think the move is land this and post a follow-up issue to clean those up? What do you think? |

On
ai7 thetelemetry.metadataoption is gone. Per-call metadata goes inruntimeContext, and the app opts keys into telemetry withtelemetry.includeRuntimeContext(andincludeToolsContextfor tool context). The channel subscriber did not read either field, so there was no way to put request-level data on gen_ai spans.The subscriber now records each included
runtimeContextkey asvercel.ai.settings.context.<key>on the operation span and on itsgenerate_contentandexecute_toolchild spans. It records each includedtoolContextkey asvercel.ai.toolCall.context.<key>on theexecute_toolspan. TheruntimeContextnames match@ai-sdk/otel(ai.settings.context.*) under the usualai.*tovercel.ai.*renaming.aibefore 7.0.114 published the full context to the channel and ignored the include lists. A filtered context looks the same as an unfiltered one, so the subscriber only reads context from events that carryaiVersion, whichaiadded in 7.0.154. Older 7.x versions record no context, so keys the app did not opt in never leave it.Fixes #24706
Fixes JS-3788