feat(telemetry): emit gen_ai.request.* from tracing plugin (post-#1045)

Aperta
#1,068 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
observability

Direzione di ricerca

Start from the GENERATION_PRE_CALL hook and BackendTracingPlugin, which only exist after #1045 merges, and read start_generate_span to see where gen_ai attributes are set today. Capture the final resolved model_options just before the SDK call, not the dict at span start. Done means gen_ai.model_options.<key> (or the agreed OTel names) appears on backend spans. The maintainers have not settled pass-through versus remapping, so confirm that in the thread first.

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

Descrizione

area/backends area/telemetry enhancement p2

Problem

gen_ai.request.temperature, gen_ai.request.top_p, and related request-parameter attributes are not emitted on backend spans today.

A model_options/_REQUEST_PARAM_MAP approach was prototyped in PR #1036 but withdrawn following review from @jakelorocco and @ajbozarth:

  • No backend call site passed model_options, so the code was dead.
  • Even if wired, the values would be pre-substitution — Mellea backends mutate model_options before handing them to the SDK (defaults merged, provider-specific renames, unsupported keys stripped). The dict visible at the top of start_generate_span is not what goes over the wire.
  • Per @jakelorocco: prefer pass-through as gen_ai.model_options.<key> over a hardcoded remap to OTel-standard names, since the naming differs between providers anyway.

Approach

After #1045 lands and BackendTracingPlugin exists:

  1. Capture the final resolved model_options dict in the GENERATION_PRE_CALL hook — the point immediately before the SDK call, where values match what the provider receives.
  2. Emit each key/value as gen_ai.model_options.<key> (pass-through, not remapped), or decide at that point whether OTel-standard names (gen_ai.request.temperature etc.) are worth the remap given cross-provider naming differences.

Prerequisites

  • #1045 (Phase 1 plugin/hook pattern) must merge first.

Related

Epic #444 Phase 2.
PR #1036 (where the dead-code prototype was withdrawn).

Lingua principale
Python
Stelle
1.8k
Fork
161
Merge medio
4g 3h
PR unite (30g)
45

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 generative-computing/mellea

Tutte le issue di generative-computing/mellea

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.