Skip to content

Decision model observability

Every ask call that passes validation records an OpenTelemetry span, whichever decision model answers it. With tracing set up, you see each decision next to the agent’s model and tool calls. When a tool asks a decision model, the decision span nests under that tool call’s span. The span reports the tokens of that one decision; Decisions in an agent covers adding them to the agent’s request.

The span is named decision and records:

NameKindValue
gen_ai.operation.nameAttributedecision
gen_ai.decision.latency_msAttributeTime the decision model spent on the call, in milliseconds.
gen_ai.usage.input_tokensAttributeInput tokens, when the decision model reports usage.
gen_ai.usage.output_tokensAttributeOutput tokens, when the decision model reports usage.
gen_ai.decision.questionsEventThe question ids.
gen_ai.decision.answersEventThe answers as JSON, keyed by question id. An Uncertain answer appears as {"uncertain": true}, with its reason when there is one.

When the decision model raises, the span ends with an error status and records the exception. Invalid questions, or an invocation context the SDK didn’t create, raise before the span starts. The question text and the input aren’t recorded.