vercelAIIntegration: `experimental_telemetry.metadata` no longer recorded on gen_ai spans (v11 regression, `ai` <= 6)
@isaacs 已经在做这个了。
开始于 2026年9月24日。
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- TypeScript
- 星标
- 8.7k
- 派生
- 1.9k
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 552
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-javascript 的其他 Issue
-
Browser Bug Next.js Traces
难度 2/5 1-3 小时 新手友好度 75/100
getsentry/sentry-javascript#24672 · 2 条评论 · 已指派 1 人 ·
-
javascript
难度 2/5 1-3 小时 新手友好度 75/100
getsentry/sentry-javascript#24200 · 2 条评论 ·
-
javascript Task
难度 2/5 1-3 小时 新手友好度 82/100
getsentry/sentry-javascript#24134 · 1 条评论 ·
-
Cloudflare Workers javascript Tests
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-javascript#24051 · 1 条评论 ·
-
Bug Bun javascript
难度 2/5 1-3 小时 新手友好度 92/100
getsentry/sentry-javascript#24045 · 1 条评论 ·
查看 getsentry/sentry-javascript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
diegosouzapw/OmniRoute#14869 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 94/100
-
status: waiting triage
难度 2/5 1-3 小时 新手友好度 84/100
freeCodeCamp/freeCodeCamp#70412 ·
-
Mend: dependency security vulnerability untriaged
难度 1/5 1 小时以内 新手友好度 88/100