Repository navigation
feat(attributes): Add vercel.ai.telemetry.metadata.<key> attribute - #662
Merged
Merged
Conversation
isaacs
requested review from
a team,
Lms24,
alexander-alderman-webb,
cleptric,
mjq and
nsdeschenes
as code owners
October 2, 2026 03:37
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Op
Bug Fixes 🐛
Internal Changes 🔧Deps
🤖 This preview updates automatically when you update the PR. |
andreiborza
approved these changes
Oct 5, 2026
The Vercel AI integration in sentry-javascript records the `experimental_telemetry.metadata` of an AI SDK call as `vercel.ai.telemetry.metadata.<key>` span attributes. SDK v10 did this through the AI SDK's own OTel spans. A fix in v11 restores it for `ai` 4 to 6 (getsentry/sentry-javascript#24721). The type is `any`. The AI SDK allows strings, numbers, booleans and arrays of these as metadata values, and the SDK sends them unchanged. The schema allows only one type per attribute, so `any` is the only type that covers all of these values. The docs content schema did not accept `any`, though `schemas/attribute.schema.json` allows it, as of #273. No attribute used `any` before. Related: getsentry/sentry-javascript#24721 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
If vercel ever does make it more strict, we can fold it in somewhere else.
isaacs
force-pushed
the
isaacs/vercel-ai-telemetry-metadata
branch
from
October 5, 2026 14:26
83d38bb to
19fbd7d
Compare
vgrozdanic
reviewed
Oct 5, 2026
vgrozdanic
approved these changes
Oct 5, 2026
isaacs
enabled auto-merge (squash)
October 5, 2026 18:18
isaacs
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Oct 5, 2026
… on gen_ai spans v10 got `vercel.ai.telemetry.metadata.<key>` attributes from the AI SDK's own OTel spans. In v11, `ai` 4 to 6 go through the orchestrion subscriber, which never read `metadata`, so v11 dropped it. The orchestrion subscriber now passes the metadata to the channel subscriber, which sets it as span attributes when each span starts. The `invoke_agent`, `generate_content` and `embeddings` spans get the attributes, and `execute_tool` spans don't. This matches the AI SDK, which leaves metadata off its `ai.toolCall` spans. Values are cast to string, as discussed in the linked sentry-conventions PR. If this causes a problem we can revisit, but all extant examples found in the wild are strings already, so it is likely safe, and extremely cheap. fixes JS-3800 fixes #24720 Re: #24706 Re: getsentry/sentry-conventions#662 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isaacs
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Oct 5, 2026
… on gen_ai spans v10 got `vercel.ai.telemetry.metadata.<key>` attributes from the AI SDK's own OTel spans. In v11, `ai` 4 to 6 go through the orchestrion subscriber, which never read `metadata`, so v11 dropped it. The orchestrion subscriber now passes the metadata to the channel subscriber, which sets it as span attributes when each span starts. The `invoke_agent`, `generate_content` and `embeddings` spans get the attributes, and `execute_tool` spans don't. This matches the AI SDK, which leaves metadata off its `ai.toolCall` spans. Values are cast to string, as discussed in the linked sentry-conventions PR. If this causes a problem we can revisit, but all extant examples found in the wild are strings already, so it is likely safe, and extremely cheap. fixes JS-3800 fixes #24720 Re: #24706 Re: getsentry/sentry-conventions#662 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isaacs
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Oct 5, 2026
… on gen_ai spans (#24721) v10 got `vercel.ai.telemetry.metadata.<key>` attributes from the AI SDK's own OTel spans. In v11, `ai` 4 to 6 go through the orchestrion subscriber, which never read `metadata`, so v11 dropped it. The orchestrion subscriber now passes the metadata to the channel subscriber, which sets it as span attributes when each span starts. The `invoke_agent`, `generate_content` and `embeddings` spans get the attributes, and `execute_tool` spans don't. This matches the AI SDK, which leaves metadata off its `ai.toolCall` spans. Values are cast to string, as discussed in the linked sentry-conventions PR. If this causes a problem we can revisit, but all extant examples found in the wild are strings already, so it is likely safe, and extremely cheap. fixes JS-3800 fixes #24720 Re: #24706 Re: getsentry/sentry-conventions#662 Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
alexander-alderman-webb
approved these changes
Oct 6, 2026
4 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Vercel AI integration in sentry-javascript records the
experimental_telemetry.metadataof an AI SDK call asvercel.ai.telemetry.metadata.<key>span attributes. SDK v10 did this through the AI SDK's own OTel spans. A fix in v11 restores it forai4 to 6 (getsentry/sentry-javascript#24721).The type is
string. The AI SDK also allows numbers, booleans and arrays as metadata values, but in practice users pass strings. SDKs convert other values to strings. The attribute stays open-ended on purpose, because the AI SDK does not define the metadata keys.Related: getsentry/sentry-javascript#24721
PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)apply_scrubbing(i.e.manualorauto. Useneveronly for values that should never be scrubbed such as IDs)If an attribute was deprecated: