Drop 'unknown' model fallbacks across AI integrations

オープン
#25,353 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #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時間
マージ済み PR(30日)
744

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-javascript のほかの issue

getsentry/sentry-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。