Skip to content

tracing: record decisions content under the GenAI convention - #31

Open
sqaisar wants to merge 1 commit into
mainfrom
sqaisar/decisions-genai-content
Open

sqaisar wants to merge 1 commit into
mainfrom
sqaisar/decisions-genai-content

Conversation

@sqaisar

@sqaisar sqaisar commented Oct 13, 2026 •

Copy link
Copy Markdown

Description

With AI_GATEWAY_TRACING_SEMCONV=gen_ai and OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true, /v1/decisions spans record only operation, model and usage, so any GenAI-convention backend shows the span without input or output. The OpenInference recorder already records both.

This maps the Decisions request and response to the standard content attributes, gated by the existing capture setting:

  • input to gen_ai.input.messages: a string becomes one user message; user messages keep input_text as text parts and record input_image as an image part without the payload, matching chat completions.
  • questions to gen_ai.system_instructions, one JSON text part per question. They are the instructions the model evaluates the input against, provided separately from it.
  • answers to gen_ai.output.messages, one assistant message with a JSON text part per answer, since the conventions define no part type for typed decision answers.

The tracing doc's list of endpoints with mapped content now includes decisions.

Related Issues/PRs (if applicable)

Related PR: theagentrouter#2819

Special notes for reviewers (if applicable)

Tests cover string, message, image and malformed input, questions, answers, and capture on and off; the endpoint coverage table is updated. make format spellcheck editorconfig lint pass.

Map the Decisions input, questions and answers to gen_ai.input.messages, gen_ai.system_instructions and gen_ai.output.messages when message content capture is enabled.

Signed-off-by: Shabab Qaisar <sqaisar@pypestream.com>
@sqaisar
sqaisar force-pushed the sqaisar/decisions-genai-content branch from 7955bf6 to a015d31 Compare October 13, 2026 07:06
@sqaisar sqaisar changed the title fix(tracing): record decisions input, questions and answers under gen_ai semconv tracing: record decisions content under the GenAI convention Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant