Skip to content

Observability

Tracing

  • Every job gets a job_id and trace_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

MetricSourceUse
Queue depth per agent typeRedis (LLEN)Autoscaling signal
Job latency (enqueue → result)Orchestrator job trackerPrimary SLO
Worker p50/p95/p99 latencyWorker self-reportPer-agent SLO
Tool cascade call countOrchestratorCost and behavior tracking
Orchestrator synthesis token countOrchestratorCost tracking
Schema validation failuresOrchestrator + workerQuality 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.

Marchay Platform Documentation