The local demos already record trace records for retrieval, governance decisions, tool calls, approvals, blocked side effects, eval regressions, and release triage decisions. scripts/export_traces_otel.py converts those local records into an OTLP/JSON-compatible shape:
resourceSpans
-> resource attributes
-> scopeSpans
-> spans
-> span attributes and events
The exporter is deterministic and local-first. It does not require an OpenTelemetry collector, network access, or an API key. For optional collector handoff notes, see docs/opentelemetry_collector_handoff_troubleshooting.md.
Generate fresh trace evidence, then export:
python -B scripts/dev.py replay
python -B scripts/dev.py otel-tracesDefault output:
otel_traces.json
That file is generated output and ignored by git.
Project 1 traces become copilot.query spans.
Important attributes:
app.projectapp.trace_typeapp.user_idapp.questionapp.abstainedapp.abstain_reasonapp.model_providerapp.retrieval.hit_countapp.permission_blocked_countapp.citation_countapp.security_event_count
Important events:
retrieval.completedevidence.citedsecurity.event
Project 2 traces become ops_agent.process_message spans.
Important attributes:
app.projectapp.trace_typeapp.user_idapp.messageapp.intentapp.model_routerapp.tool_call_countapp.approval_countapp.blocked_action_countapp.cited_policy_count
Important events:
tool.callapproval.requestedgovernance.blocked_actionpolicy.cited
Project 3 traces become reliability.release_triage spans.
Important attributes:
app.projectapp.trace_typeapp.user_idapp.release_idapp.release_statusapp.release_traffic_percentapp.incident_idapp.incident_statusapp.incident_severityapp.incident_categoryapp.eval_run_idapp.failed_eval_countapp.recommendationapp.release_blockedapp.runbook_countapp.signal_countapp.audit_event_count
Important events:
release.triage_decisionrelease.contextrelease.rollout_blockedrelease.rollout_monitoredincident.signaleval.failure.linkedrunbook.linkedaudit.linked
In production, this local exporter would become one of two paths:
- Native OpenTelemetry SDK instrumentation around API handlers, retrieval, model calls, tool calls, approval writes, release decisions, eval gates, and audit writes.
- A batch bridge that converts persisted trace records into OTLP JSON and sends them to an OpenTelemetry Collector.
The production design should preserve the same invariants:
- permission checks happen before evidence reaches the model
- approval gates happen before external side effects
- blocked actions are observable events, not hidden failures
- release rollout decisions link incidents, failed eval cases, runbooks, and audit events
- trace IDs connect UI output, audit events, eval cases, and logs
- eval and demo traces are tagged separately from production traffic
- OpenTelemetry Protocol File Exporter: https://opentelemetry.io/docs/specs/otel/protocol/file-exporter/
- OpenTelemetry Protocol Exporter: https://opentelemetry.io/docs/specs/otel/protocol/exporter/