Drop 'unknown' model fallbacks across AI integrations

未关闭
#25,353 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #25379 来自 @kashish00208 —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
observability

调研方向

Start by finding where gen_ai.request.model is set to 'unknown' in packages/server-utils/src/ai/openai/index.ts and the span-name builder in ai/openai/utils.ts, then check the same pattern in the Anthropic, Google GenAI, LangChain and Workers AI files listed in the issue. Done means no model means no gen_ai.request.model attribute and the span is named only by its operation (e.g. chat), with and without span streaming. The review thread linked from PR 25285 explains the intent.

由索引模型根据 Issue 内容生成。

描述

When a request has no model, the AI integrations set gen_ai.request.model to 'unknown', and the span name becomes <operation> unknown. With span streaming the name drops the model, but the attribute stays.

If there is no model, do not set gen_ai.request.model. The span name is then only the operation (for example chat), with or without span streaming.

Affected integrations (in packages/server-utils/src):

  • OpenAI: ai/openai/index.ts, ai/openai/utils.ts, integrations/openai.ts
  • Anthropic: ai/anthropic-ai/index.ts
  • Google GenAI: ai/google-genai/index.ts, integrations/google-genai.ts
  • LangChain: ai/langchain/index.ts, ai/langchain/utils.ts, ai/langchain/embeddings.ts
  • Workers AI: ai/workers-ai/index.ts, ai/workers-ai/utils.ts

Raised in review: https://github.com/getsentry/sentry-javascript/pull/25285#discussion_r4267469713

Also evaluate other usages of unknown through out all ai integrations.

Furthermore, create test cases where we call providers without specifying a model.

主要语言
TypeScript
星标
8.8k
派生
1.9k
平均合并
1 天 8 小时
30 天内合并 PR
744

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-javascript 的其他 Issue

查看 getsentry/sentry-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。