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:
- 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.
- 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
Related
Epic #444 Phase 2.
PR #1036 (where the dead-code prototype was withdrawn).
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_MAPapproach was prototyped in PR #1036 but withdrawn following review from @jakelorocco and @ajbozarth:model_options, so the code was dead.model_optionsbefore handing them to the SDK (defaults merged, provider-specific renames, unsupported keys stripped). The dict visible at the top ofstart_generate_spanis not what goes over the wire.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
BackendTracingPluginexists:model_optionsdict in theGENERATION_PRE_CALLhook — the point immediately before the SDK call, where values match what the provider receives.gen_ai.model_options.<key>(pass-through, not remapped), or decide at that point whether OTel-standard names (gen_ai.request.temperatureetc.) are worth the remap given cross-provider naming differences.Prerequisites
Related
Epic #444 Phase 2.
PR #1036 (where the dead-code prototype was withdrawn).