Agent Phase Observability & Trace Visualization
Structured spans per agent phase (planner, generator, evaluator, handoff) with timing, token counts, model, cost, and error info. Frontend timeline component showing phases as visual blocks with drill-down. OpenTelemetry export for external tools (Jaeger, Honeycomb, Datadog).
Key Deliverables
- AgentSpan schema — Pydantic model + SQLAlchemy model for structured phase spans with timing, token counts, cost, error info
- PostgreSQL
agent_spans table — Alembic migration with indexes on trace_id, thread_id, started_at
- Span lifecycle utilities (
backend/src/utils/tracing.py) — start_span, end_span, @trace_phase context manager with contextvars-based trace propagation
- REST API endpoints —
GET /threads/{id}/traces, GET /traces/{id}/spans/{id} for frontend consumption
- Frontend swimlane timeline — horizontal colored phase blocks with hover tooltips (duration, tokens, cost) and click drill-down
- OpenTelemetry OTLP exporter — optional export to Jaeger/Honeycomb/Datadog, zero overhead when disabled
Spec
See /.claude/specs/agent-observability.md for full details.
Milestone
v0.10.0 — Harness Design v2
Agent Phase Observability & Trace Visualization
Structured spans per agent phase (planner, generator, evaluator, handoff) with timing, token counts, model, cost, and error info. Frontend timeline component showing phases as visual blocks with drill-down. OpenTelemetry export for external tools (Jaeger, Honeycomb, Datadog).
Key Deliverables
agent_spanstable — Alembic migration with indexes ontrace_id,thread_id,started_atbackend/src/utils/tracing.py) —start_span,end_span,@trace_phasecontext manager withcontextvars-based trace propagationGET /threads/{id}/traces,GET /traces/{id}/spans/{id}for frontend consumptionSpec
See
/.claude/specs/agent-observability.mdfor full details.Milestone
v0.10.0 — Harness Design v2