Skip to content

feat: OpenTelemetry trace export for agent runs (agentic-first observability) #362

Description

@spboyer

Problem

Waza emits internal session events but doesn't expose them in any industry-standard shape. Authors and platform teams who already run an OTel-compatible backend (Aspire, Jaeger, Tempo, Application Insights, Honeycomb, Datadog) can't drop waza into their existing observability pipeline.

Result: a debugging session means staring at results.json and transcripts instead of using familiar trace UIs.

Proposal

Add an opt-in OpenTelemetry exporter for agent runs:

  • waza run --otel-exporter <otlp|stdout|file> plus --otel-endpoint, --otel-headers.
  • Emit spans following the GenAI semantic conventions: gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.tool.name, etc.
  • Span hierarchy: evaltaskturntool_call / model_call.
  • Default-off; default redaction policy strips prompt/tool-arg/output content unless --otel-include-payloads is set.
  • Best-effort trace ID propagation: preserve trace IDs if the engine surfaces them; do not require Copilot SDK changes.

Why this matters for agentic-first

Agentic runs are graph-shaped (turns × tools × sub-agents). Flat logs hide the structure. OTel traces are how the rest of the industry navigates this shape, and exporting them means waza fits into the observability stack teams already pay for.

Acceptance criteria

  • OTel exporter integrated; off by default.
  • Spans conform to gen_ai.* semantic conventions; schema-test verifies attribute names without requiring a live backend.
  • Default redaction strips prompt/tool-arg/output content; opt-in flag to include them.
  • Works with at least OTLP/HTTP and stdout exporters.
  • No new required dependency for users who don't enable it.
  • Docs in site/ with an example wiring to a local collector.
  • Tests assert span shape and redaction behavior.

Non-goals (filed separately)

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions