Skip to content

feat: Agent phase observability — structured traces with frontend timeline #904

@ryaneggz

Description

@ryaneggz

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 endpointsGET /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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestharness-designHarness design feature set (v0.9-v0.10)phase-3Phase 3: Observability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions