OpenTelemetry Trace Export
waza can emit OpenTelemetry traces for every eval run so you can analyze agent
behavior in the same observability stack you use for the rest of your
applications. The integration is opt-in — no telemetry leaves your machine
unless you pass --otel-exporter.
Span hierarchy
Section titled “Span hierarchy”Each run produces a tree of spans rooted at the eval invocation. A turn wraps
one actor Execute call, including failure paths, and ends before checkpoints,
follow-ups, responder classification, and grading. Follow-up and responder-reply
turns are siblings under the task, not children of the initial turn.
graph TD Eval["eval (spec.id, model)"] --> Task1["task (task.id)"] Eval --> Task2["task (task.id)"] Task1 --> Turn1["turn (kind=initial)"] Turn1 --> Tool1["tool_call (observed boundaries and call ID)"] Turn1 -.-> Usage1["usage and model observation events"] Task1 --> Grading["grading / checkpoint phase"] Grading -.-> GraderUsage["grader usage events"] Task2 --> Turn2["turn (kind=initial)"] Turn2 -.-> Tool2["tool observation (timing unavailable)"]Attributes reuse OpenTelemetry GenAI semantic convention keys
(gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens,
gen_ai.usage.output_tokens, gen_ai.tool.name, gen_ai.tool.call.id, …)
where applicable. These conventions are evolving; Waza observation events are
not individual GenAI operation spans.
Post-execution usage and untimed diagnostic events are timestamped at the observed actor-execution end, within the exported turn interval. Projection work does not extend the actor span or fabricate an API-call timestamp.
Observed operations versus observations
Section titled “Observed operations versus observations”waza.tool_call is emitted only with one unambiguous SDK start/completion pair,
a matching tool name, agent identity and call ID, and nonzero, strictly increasing event
timestamps. Its boundaries are those recorded timestamps, not the time Waza
exports the response. A missing, equal, reversed or ambiguous pair becomes a
waza.tool_observation event with waza.observation.timing=unavailable.
Without a matched completion, waza.tool.success is omitted, not assumed false.
SDK assistant.usage events become waza.model_observation events. They carry
the reported response model, optional waza.model.call.id, and optional
waza.model.reported_duration_ms (milliseconds). Multiple observations for one
model are not collapsed into a synthetic call. An event’s creation timestamp
does not establish an API-call end boundary: no model-call span is synthesized
from that timestamp and a reported duration. Missing IDs stay missing; counting
these events is not a verified count of unique calls.
Turns report the configured engine as waza.eval.engine; a mock or custom
engine is never labeled gen_ai.system=github_copilot. Engine identity does not
establish a model provider’s identity, including when Copilot routes to BYOK.
Usage scope and units
Section titled “Usage scope and units”Usage is emitted as waza.usage events on actor turns and grading phases, never synthetic
waza.model_call spans. Only events with waza.usage.state=available contain
numeric counters. waza.observation.timing=aggregate explicitly distinguishes
these observations from individual model calls.
Usage events are appended after diagnostic model/tool observations, so high diagnostic volume cannot evict terminal usage from OpenTelemetry’s bounded event queue. Standard SDK event limits still apply to the usage records themselves; configure sufficient capacity for the number of per-model usage records in a turn. Older diagnostic observations may be dropped.
| Attribute | Meaning |
|---|---|
waza.usage.scope=execution_delta |
Engine-declared non-cumulative usage for this execution. |
waza.usage.scope=session_delta |
Increase between known cumulative session snapshots, scoped to this attempt. |
waza.usage.scope=unavailable |
Execution returned no response, so neither counters nor their cumulative/per-execution scope are known. |
gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.usage.cache_read_tokens |
Recorded token counts for the declared delta scope, including explicitly recorded zero. |
waza.usage.request_count |
Per-model request count, from ModelUsage.RequestCount; not premium cost. |
waza.usage.premium_request_cost |
Fractional Copilot premium-request units, from per-model RequestCost or aggregate PremiumRequests; not request count, currency or AI credits. |
waza.usage.provider |
Observed provider route, or unknown. Custom and mixed routes never emit a premium cost. |
gen_ai.response.model |
Observed model key on per-model usage events; absent on aggregate-only events. |
waza.session.id |
Recorded session identity on each usage event, including separate grader sessions; absent when unknown. |
Per-model events replace the aggregate token event; they are not exported alongside a duplicate aggregate total. Aggregate-only usage does not infer a request count. This projection does not export AI credits or currency.
A newly created session has a zero baseline. Resuming a session requires a complete pre-execution snapshot; otherwise the first complete observation establishes a baseline without exporting counters. For example, known snapshots of 100 then 180 input tokens export deltas of 100 then 80 for a new session, not 100 then 180. With an unknown resumed baseline, the first is withheld and only the later increase of 80 is available.
Cumulative snapshots are consumed in the runner’s sequential execution order.
Where the engine supplies nonzero revisions, duplicates, older revisions and
loss of an established revision are rejected as out_of_order. Unknown revisions
do not establish ordering outside this sequential caller. Counter resets,
provider-route changes or incompatible model attribution produce
reset_or_incompatible; the next valid observation can use the new baseline.
Missing or incomplete snapshots invalidate the baseline instead of silently
bridging an evidence gap.
Session deltas cover the interval between snapshots, not a measured model call.
waza.grading and waza.checkpoint spans bound the actual grading phases;
their prompt-grader responses use the same attempt-local usage baselines as
actor turns. Continuing a session therefore exports only the grader’s new
delta, including terminal grading after the last actor turn, without counting
it again at the next actor turn. Separate grader sessions are recorded when the
actual producing executor supplies complete usage observations. Isolated
evidence judges retain their own collector’s presence metadata at runtime,
rather than borrowing the actor engine’s observation; it is not added to saved
artifacts. A failed or cancelled grader that returns no response emits missing
without counters. A known continued session retains its ID but loses its usage
baseline, so the next complete snapshot re-establishes the baseline instead of
attributing the grader’s unobserved usage to the next actor. A fresh isolated
judge with no response has no invented session identity.
All actor turns, including follow-up and responder turns, and grading phases
carry the attempt’s waza.turn.trial; checkpoint phases also carry
waza.turn.number to identify the checkpoint boundary. Existing session-ID
privacy policy is unchanged. Classifier sessions are not
instrumented here. These phase spans do not claim individual model-call timing.
Other unavailable states are missing, incomplete, presence_unavailable,
session_unavailable, baseline_unavailable, and invalid. None carries numeric
usage. Presence is conservatively gated by the engine’s complete
SessionUsageObservation, including its billing-presence checks: older runtimes,
partial SDK events and engines without that observation interface may therefore
withhold even known token fields. No absent scalar is repaired into zero.
Compatibility: this intentionally changes the opt-in trace shape: remove
queries that sum waza.model_call usage or use overloaded
waza.usage.premium_requests; consume available waza.usage event deltas with
the units above instead. Do not mix old and new trace shapes in one sum.
Saved evaluation artifacts, dashboard billing, product-usage collection and
waza runner telemetry are unchanged. Tracing remains off by default.
CLI flags
Section titled “CLI flags”| Flag | Description |
|---|---|
--otel-exporter |
Exporter to use: otlp, stdout, or file. Omit (default) to keep telemetry off. |
--otel-endpoint |
OTLP/HTTP endpoint (e.g. localhost:4318 or https://collector.example.com). Only used with --otel-exporter=otlp. |
--otel-headers |
Comma-separated key=value pairs added to OTLP requests (useful for auth). |
--otel-file |
Output path for newline-delimited span JSON when --otel-exporter=file. |
--otel-include-payloads |
Include prompts, tool arguments, tool results, and completions in spans. Off by default — only sha256 + byte length are emitted. |
Quick start: local collector
Section titled “Quick start: local collector”The fastest way to see waza traces is the standard OTel Collector container listening on the default OTLP/HTTP port.
services: otel-collector: image: otel/opentelemetry-collector-contrib:latest command: ["--config=/etc/otelcol/config.yaml"] volumes: - ./otel-config.yaml:/etc/otelcol/config.yaml ports: - "4318:4318" # OTLP HTTPreceivers: otlp: protocols: http:
exporters: debug: verbosity: detailed
service: pipelines: traces: receivers: [otlp] exporters: [debug]Bring it up, then run waza pointed at it:
docker compose up -dwaza run ./evals/my-skill/eval.yaml \ --otel-exporter otlp \ --otel-endpoint localhost:4318Spans appear in the collector’s stdout. Swap the debug exporter for
otlphttp, jaeger, tempo, azuremonitor, or any other backend.
Stdout and file exporters
Section titled “Stdout and file exporters”For quick inspection without a collector:
# Stream spans as JSON to stderrwaza run eval.yaml --otel-exporter stdout
# Write spans to a file (newline-delimited JSON)waza run eval.yaml --otel-exporter file --otel-file traces.jsonPayload redaction
Section titled “Payload redaction”By default waza strips prompt, tool-argument, tool-result, and completion content from spans — only the SHA-256 digest and byte length are recorded under per-slot keys so multiple redacted payloads on the same span (e.g. prompt + completion, or tool arguments + result) do not collide:
| Slot | Hash key | Length key |
|---|---|---|
| Prompt | waza.prompt.sha256 |
waza.prompt.length |
| Completion | waza.completion.sha256 |
waza.completion.length |
| Tool arguments | waza.tool.arguments.sha256 |
waza.tool.arguments.length |
| Tool result | waza.tool.result.sha256 |
waza.tool.result.length |
This keeps raw user prompts and tool outputs out of your trace backend, not all potentially identifying metadata. Session/call IDs, tool/model names and workspace paths retain the existing export policy. Hashes enable correlation and are not anonymization.
Tool arguments use the canonical raw SDK start event correlated by call ID,
not an empty typed digest for free-form tools such as apply_patch. Arguments
are JSON-encoded before hashing or opt-in export; a string argument therefore
includes JSON quotes and escaping in its hash/byte length. Historical responses
without raw events fall back to their typed tool digest. Ambiguous raw evidence
is withheld rather than selecting another call’s payload.
To capture full payloads (e.g. for debugging in a private collector), pass:
waza run eval.yaml --otel-exporter otlp --otel-include-payloadsWhen enabled, the following attributes carry full content instead of the hash/length surrogates:
gen_ai.prompt— user/system prompt sent to the modelgen_ai.completion— model completion textgen_ai.tool.arguments— JSON arguments passed to a toolgen_ai.tool.result— tool execution output
Responder decision telemetry
Section titled “Responder decision telemetry”When an adaptive responder
classification records a rejected or duplicate decision-tool call, Waza adds a
waza.responder.decision_calls event to the span active in the classification
context and logs a responder decision call rejected warning with the same
per-call fields. Classifications without a rejected or duplicate call emit
neither. Responder rounds after an actor turn run in the task context; a
responder answering a native user-input request runs inside the asking turn.
Responder sessions are not instrumented with their own spans, and the event is
a no-op when tracing is disabled. The warning is logged either way.
The event lists every decision call recorded in that classification, including accepted calls, as parallel arrays in call order:
| Attribute | Type | Meaning |
|---|---|---|
waza.responder.decision.call_count |
int | Number of recorded decision calls. |
waza.responder.decision.call.response_index |
int[] | Zero-based responder model response that issued each call; -1 for every call when the session events cannot be correlated reliably. |
waza.responder.decision.call.tool |
string[] | Decision tool name: responder_reply, responder_stop or responder_abstain. |
waza.responder.decision.call.outcome |
string[] | accepted, rejected_empty, rejected_malformed or duplicate_decision. |
waza.responder.decision.call.answer_length |
int[] | Byte length of each responder_reply answer; 0 for other tools or undecodable arguments. |
The event never records answer text, abstain reasons, other argument values,
tool-call IDs or turn IDs, and --otel-include-payloads does not add them. It
is diagnostic only: the classification still fails with the first rejection,
and correlation never changes the outcome.
Authentication and headers
Section titled “Authentication and headers”Some collectors require API keys. Use --otel-headers:
waza run eval.yaml \ --otel-exporter otlp \ --otel-endpoint https://collector.example.com \ --otel-headers "x-api-key=$OTEL_API_KEY,x-team=skills"- The exporter is best-effort: failures to flush at shutdown log a warning but do not fail the run.
- When
--otel-exporteris unset, the OTel SDK is not initialized and no trace usage projection or export is performed. - waza calls
SetGlobalon the configured tracer provider so engines or libraries that look up the global provider (for trace ID propagation into the Copilot SDK or HTTP clients) attach to the same trace.