Appearance
Observability
Tracing
- Every job gets a
job_idandtrace_id(OpenTelemetry) - The Orchestrator emits a parent span for the whole interaction
- Worker jobs are child spans under the parent
- Tool cascade calls are sub-spans within the Orchestrator's span
A single user turn should be reconstructable end-to-end from one trace ID.
Logging
- Orchestrator: Tool cascade calls, decompose decisions, dispatch events, synthesis calls, re-plan events
- Workers: Job received, tool calls (with durations), completion, result summary
- All services: Structured JSON, indexed by
session_id,job_id,trace_id
Metrics
| Metric | Source | Use |
|---|---|---|
| Queue depth per agent type | Redis (LLEN) | Autoscaling signal |
| Job latency (enqueue → result) | Orchestrator job tracker | Primary SLO |
| Worker p50/p95/p99 latency | Worker self-report | Per-agent SLO |
| Tool cascade call count | Orchestrator | Cost and behavior tracking |
| Orchestrator synthesis token count | Orchestrator | Cost tracking |
| Schema validation failures | Orchestrator + worker | Quality signal |
Alerts
- Queue depth sustained above threshold for a given agent
- Job p95 latency above SLO for a given agent
- Orchestrator re-plan rate spike (signal of brief quality or worker regressions)
- Redis connection errors
- Result schema validation failure rate above baseline
Cost Telemetry
The Orchestrator should log the per-turn token cost and tool call cost, broken down by phase (context load, dispatch, synthesis). This is the input to cost optimization. You can't optimize what you can't attribute.