Drop 'unknown' model fallbacks across AI integrations

Offen
#25,353 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #25379 von @kashish00208 — ohne Merge geschlossen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
62/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
observability

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
8.8k
Forks
1.9k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
744

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-javascript

Alle Issues in getsentry/sentry-javascript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.