You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gap 5 from #1035: Mellea does not emit chat content span events, so the conversation transcript is invisible in OTel backends. Metadata (tokens, model, latency) is present on backend spans but prompts and responses are not.
Per the OTel GenAI semconv, content capture should use span events with these names, each carrying structured role + content:
gen_ai.system.message
gen_ai.user.message
gen_ai.assistant.message
gen_ai.tool.message
gen_ai.choice
Additionally, OpenInference-compatible system instruction capture:
The component-level approach (passing conversation/output_text through finalize_backend_span) required changes to all 5 backends and was withdrawn as too much churn. After #1045, BackendTracingPlugin receives GenerationPostCallPayload which contains the conversation and output — no backend changes needed at all.
Approach
After #1045 lands and BackendTracingPlugin exists:
In BackendTracingPlugin, check is_content_tracing_enabled() before emitting.
Problem
Gap 5 from #1035: Mellea does not emit chat content span events, so the conversation transcript is invisible in OTel backends. Metadata (tokens, model, latency) is present on backend spans but prompts and responses are not.
Per the OTel GenAI semconv, content capture should use span events with these names, each carrying structured
role+content:gen_ai.system.messagegen_ai.user.messagegen_ai.assistant.messagegen_ai.tool.messagegen_ai.choiceAdditionally, OpenInference-compatible system instruction capture:
gen_ai.system_instructionsWhy deferred from PR #1036
The component-level approach (passing
conversation/output_textthroughfinalize_backend_span) required changes to all 5 backends and was withdrawn as too much churn. After #1045,BackendTracingPluginreceivesGenerationPostCallPayloadwhich contains the conversation and output — no backend changes needed at all.Approach
After #1045 lands and
BackendTracingPluginexists:BackendTracingPlugin, checkis_content_tracing_enabled()before emitting.add_span_event()helper (already wired inmellea/telemetry/tracing.pyfrom PR feat(telemetry): close five OTel GenAI semantic convention emission gaps (#1035) #1036) to emitgen_ai.user.message,gen_ai.assistant.message, etc. fromGenerationPostCallPayload.MELLEA_TRACE_CONTENT(renamedMELLEA_TRACES_CONTENTunder refactor: rename tracing env vars to plural and align with OTel semconv #1046) orOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT.The infrastructure is already in place from PR #1036:
is_content_tracing_enabled(),add_span_event(), and the_TRACE_CONTENT_ENABLEDflag.Prerequisites
BackendTracingPluginandGenerationPostCallPayloadare not available until then.Related
MELLEA_TRACE_CONTENT→MELLEA_TRACES_CONTENT)