Skip to content

feat(attributes): Add vercel.ai.telemetry.metadata.<key> attribute - #662

Open
isaacs wants to merge 2 commits into
mainfrom
isaacs/vercel-ai-telemetry-metadata
Open

isaacs wants to merge 2 commits into
mainfrom
isaacs/vercel-ai-telemetry-metadata

Conversation

@isaacs

@isaacs isaacs commented Oct 2, 2026

Copy link
Copy Markdown
Member

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

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

If an attribute was added:

  • The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • I have used the correct value for apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

If an attribute was deprecated:

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-conventions Ready Ready Preview Oct 5, 2026 2:27pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add vercel.ai.telemetry.metadata.<key> attribute by isaacs in #662
  • Add nel.sampling_fraction by loewenheim in #668

Op

  • Add gen_ai.evaluate op by andreiborza in #650
  • Deprecate framework-specific span ops by Lms24 in #622
  • Add span op deprecation support by Lms24 in #621

Bug Fixes 🐛

  • (descriptions) Define template substitution for array values by s1gr1d in #663
  • (gen_ai) Map Anthropic tool results to canonical attribute by obostjancic in #660

Internal Changes 🔧

Deps

  • Bump brace-expansion from 5.0.9 to 5.0.12 by dependabot in #665
  • Bump devalue from 5.9.2 to 5.9.4 by dependabot in #666
  • Bump dompurify from 3.4.13 to 3.4.16 by dependabot in #664

🤖 This preview updates automatically when you update the PR.

isaacs and others added 2 commits October 5, 2026 07:26
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.
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']),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't support objects (which any could be) yet in EAP?

If not, i am afraid we must stringify this before sending, otherwise they might get dropped during ingestion, so iiuc this shouldn't be any just yet?

This branch was successfully deployed

1 active deployment
Preview — 19fbd7df Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants