Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Attributes

Everything mocon writes. The specification has the normative detail.

Both spans

Attribute
code_mode.observes_crossingsall, some or none
code_mode.unmediated_egresscan the program get out without you seeing
code_mode.crossing_edgeinvocation or dispatch
code_mode.attestedwhat your server observed
code_mode.attested_attributesyour keys you measured
code_mode.relayed_attributesyour keys a target reported
code_mode.execution.idyour own run id, on every span of the run
code_mode.capturewhat got truncated or redacted
code_mode.provenance.<key>P or T for any value your server didn’t observe

Run span

Attribute
gen_ai.operation.namealways execute_code
code_mode.execution.dispositioncompleted, failed, terminated, abandoned
code_mode.program.hashsha256 of the program, always written
code_mode.program.languagea display hint, omit rather than guess
code_mode.program.textthe program, opt-in
code_mode.declaredwhat your own attributes mean
code_mode.output.<channel>stdout, stderr and so on, opt-in
gen_ai.tool.nameyour code-mode tool’s name
gen_ai.tool.call.idthe caller’s id for this dispatch
gen_ai.conversation.idonly if your grouping really is a conversation
mcp.session.idthe MCP session
error.typewhen the run failed

Call span

Attribute
gen_ai.operation.namealways execute_tool
gen_ai.tool.namethe target
code_mode.crossing.outcomeoutput, error, abandoned
code_mode.crossing.dispatcheddid the call actually leave
code_mode.crossing.seqorder it started in, from 1
code_mode.crossing.timingset when a time had to be made up
gen_ai.tool.call.idyour own id for this call
gen_ai.tool.typefunction, extension or datastore
gen_ai.tool.call.argumentsthe input, opt-in
gen_ai.tool.call.resultthe result, opt-in
code_mode.error.messagewhy it failed, opt-in
code_mode.error.bodythe raw error, opt-in
mcp.method.name, mcp.resource.uriif the call went over MCP
error.typewhen it failed

Metrics

InstrumentUnitKeyed on
code_mode.execution.durationscode_mode.execution.disposition, error.type
code_mode.crossing.durationsgen_ai.tool.name, code_mode.crossing.outcome, error.type, only when the target is attested

Log records

Attribute
event.namecode_mode.execution.started or code_mode.execution.ended
trace_id, span_idjoin back to the spans

Plus every attribute the run span carries.

Values

Disposition is completed, failed, terminated, abandoned.

Outcome is output, error, abandoned.

Error types on a run: validation, runtime, timeout, resource_limit, cancelled, approval_rejected, host_failure, _OTHER.

Error types on a call: capability_error, validation, refused, timeout, cancelled, approval_rejected, tool_error, _OTHER.

Both lists of error types are open, so use a more specific low-cardinality name if you have one. The disposition and outcome lists are closed and nothing else is allowed.

Names

NameKind
Runexecute_code {tool}server, or internal in-process
Callexecute_tool {target}client, or internal if you serve it

If your targets are unbounded, like URLs, pass a name to keep the span name low cardinality and leave the full target in gen_ai.tool.name.

Status

Status is a display hint. Read the disposition and outcome attributes instead.

Status
completed, abandoned, outputunset
failed, terminated, errorerror

The description carries error.type, never the program’s words, because it’s the one field nothing can label.