Companion draft, separately versioned. Version: draft 0.1, for ASR format version 0.1 and the OpenTelemetry GenAI semantic conventions, whose GenAI conventions are all at “Development” status. Attribute names follow those conventions and will track them. Not part of core conformance.A trace and a session record serve different purposes. A trace is a sampled set of timed spans, with content off by default and no guarantee of ordering or replay. A session record is complete and ordered. This companion lets existing telemetry backends show ASR sessions: an exporter generates spans from a stream. The stream remains the primary record, and nothing is imported back.
Principle: spans only where timing exists
A span needs a start and an end. An exporter MUST emit a span only when the stream records both, directly or as a start plus a duration. It MUST NOT invent times from neighboring records, conversion time orobservedAt. Records without timing are not exported as spans.
Span mapping
A tool call that a program made (
parentCallId names the enclosing call, for example a code-mode cell) is exported as a child of the enclosing call’s span. A tool call with requestedBy: code and no parentCallId is exported in the turn without a parent call.
When timing is missing for a parent span, the exporter omits that parent and emits its child spans without a parent in the session’s trace.
Trace and span IDs
- When a record’s
_meta.traceparentis present, its span is placed in that trace, with the given parent. - Otherwise the trace ID is the first 16 bytes of SHA-256 over the canonical session reference (the root session’s, for a subagent tree), and each span ID is the first 8 bytes of SHA-256 over the canonical session reference,
#, and the record ID. IDs are therefore stable across exports.
Attributes
Errors: a
tool_result with status: failed or an inference with error sets the span status to error, with error.type from the source when recorded.
Content
Content is not exported by default, as the conventions require. When the user opts in:gen_ai.input.messages,gen_ai.output.messagesandgen_ai.system_instructionsare built from the expandedinference.contextwhen it is exact (see Inference), and otherwise from the context view at the inference (see Structure), using the conventions’ message parts:text→TextPart;tool_call→ToolCallRequestPart;tool_result→ToolCallResponsePart; reasoning withvisibilityfullorsummary→ReasoningPart; a compaction summary →CompactionPart; images and audio →BlobPartorUriPart.gen_ai.tool.call.argumentsandgen_ai.tool.call.resultcome frominputand the result’scontent.- Opaque reasoning,
opaquecontent parts and signatures are never exported. - Answers to questions that asked for a secret are not in the stream (ASR-283), so they cannot be exported.
- The exporter MUST respect the stream’s
contentLeveland redactions, and SHOULD apply the user’s redaction policy, since telemetry backends are often shared (see Privacy).
What is not exported
File changes, VCS actions, approvals (permission and compact decisions on results), questions (input_request), plans, memory changes, deliveries, turn triggers, senders and conversations, hooks and terminals, compaction structure, lineage facets other than subagent nesting, copies, capture states and every record without timing. Copied records are not exported as spans of the session that holds them (ASR-417). In a stream run by another session (executedBy), model calls are exported from the backing session’s stream, not from the wrapper’s usage summaries (ASR-425).