vercelAIIntegration: `experimental_telemetry.metadata` no longer recorded on gen_ai spans (v11 regression, `ai` <= 6)
I maintainer di solito rispondono entro 1 giorno
@isaacs ci sta già lavorando.
Dal 24/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
On SDK v10, vercelAIIntegration recorded experimental_telemetry.metadata as vercel.ai.telemetry.metadata.<key> span attributes. The data came from the AI SDK's own OTel spans (ai.telemetry.metadata.*), and the integration renamed every ai.* attribute to vercel.ai.*.
On v11, ai 4 to 6 go through the orchestrion subscriber (packages/server-utils/src/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.ts) instead of OTel. That subscriber reads experimental_telemetry.isEnabled, functionId, recordInputs and recordOutputs, but never metadata. The channel subscriber that builds the spans (vercel-ai-dc-subscriber.ts) doesn't set any metadata attributes either. So the metadata is dropped, and apps lose request-level context (user, tenant, request id, ...) on gen_ai spans after they upgrade.
Reproduction
await generateText({
model,
prompt: 'Hi',
experimental_telemetry: {
isEnabled: true,
functionId: 'support-chat',
metadata: { requestId: 'req_123', tenantId: 'acme' },
},
});
- Expected:
invoke_agent support-chatand itsgenerate_contentchild carryvercel.ai.telemetry.metadata.requestIdandvercel.ai.telemetry.metadata.tenantId, as on v10. - Actual (11.0.0,
ai6): neither span has anyvercel.ai.telemetry.metadata.*attribute. All other attributes (function id, messages, tokens, model) are present.
A failing integration test covers this: dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v6/scenario-telemetry-metadata.mjs, test "records experimental_telemetry.metadata as span attributes". I only checked ai 6. ai 4 and 5 use the same subscriber, so they are probably affected too.
Proposed fix
- Pass
experimental_telemetry.metadatathrough the orchestrion message builder. - In the channel subscriber, set
vercel.ai.telemetry.metadata.<key>on theinvoke_agentspan. - Copy the same attributes to child
generate_contentspans through acallIdmap, the same way asoperationIdByCallId.
Open question: v10 may also have put metadata on tool call spans. If it did, execute_tool should get it too.
Related
- #24706: the same gap on
ai7, where metadata moved toruntimeContext. - #24660 notes that neither subscriber reads
experimental_telemetry.metadataorruntimeContext.
- Lingua principale
- TypeScript
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 1g 17h
- PR unite (30g)
- 543
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-javascript
-
Browser Bug Next.js Traces
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
getsentry/sentry-javascript#24672 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
getsentry/sentry-javascript#24200 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
javascript Task
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
getsentry/sentry-javascript#24134 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Cloudflare Workers javascript Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-javascript#24051 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Bun javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
getsentry/sentry-javascript#24045 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di getsentry/sentry-javascript
Issue simili
-
ADD openalgoApertatemplate
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
vercel/ai#21528 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug Needs: Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/fluentui-contrib#671 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
sveltejs/acorn-typescript#150 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100