Drop 'unknown' model fallbacks across AI integrations

Aperta
#25,353 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #25379 di @kashish00208 — chiusa senza merge

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
observability

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
8.8k
Fork
1.9k
Merge medio
1g 8h
PR unite (30g)
744

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-javascript

Tutte le issue di getsentry/sentry-javascript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.