2.8 KiB
2.8 KiB
Observability Signals
This document describes runtime observability emitted by Agent Orchestrator.
Goals
- Structured, low-noise telemetry for session lifecycle and operator workflows.
- Correlated traces across core services, API routes, SSE, and websocket terminal health.
- Clear failure reasons and current health surfaces for fast diagnosis.
Emission Model
- Structured logs: JSON lines on stderr, controlled by
AO_LOG_LEVEL.- Supported levels:
debug,info,warn,error. - Default level:
warn(production-safe, avoids high-volume info logs).
- Supported levels:
- Durable snapshots: process-local JSON snapshots under:
~/.agent-orchestrator/{config-hash}-observability/processes/*.json
- Aggregated view: merged by project via:
GET /api/observability
Correlation
- API routes accept
x-correlation-id; when absent, AO generates one. - Responses include
x-correlation-idfor traceability from UI or CLI. - SSE snapshots include
correlationIdandemittedAt.
Metrics
Counters are emitted per project and operation:
spawn(session.spawn)restore(session.restore)kill(session.kill)claim_pr(session.claim_pr)cleanup(session.cleanup)send(session.send)lifecycle_poll(lifecycle.poll,lifecycle.transition)api_request(web API routes)sse_connect,sse_snapshot,sse_disconnectwebsocket_connect,websocket_disconnect,websocket_error(websocket servers)
Each metric counter tracks:
total,success,failurelastAt,lastSuccessAt,lastFailureAtlastFailureReason
Trace Fields
Recent traces keep operation-level diagnostics:
idtimestampcomponentoperationoutcomecorrelationIdprojectIdsessionIdpathreasondurationMsdata
Health Surfaces
Health records provide current status and failure context per surface:
surface(for example:lifecycle.worker,sse.events)status(ok,warn,error)updatedAtcomponentprojectIdcorrelationIdreasondetails
Operator-Facing Diagnostics
- Dashboard: observability banner shows overall status, SSE stream state, last correlation id, and latest failure reason.
- API:
/api/observabilityreturns merged per-project diagnostics (overallStatus, metrics, health, recent traces, session state). - Terminal websocket health:
/healthendpoints include active sessions and websocket/terminal health counters with last error/disconnect reasons.
Rollout Notes
- Deploy with default
AO_LOG_LEVEL=warnto avoid noisy logs. - Validate
/api/observabilityand dashboard banner in a canary environment. - If deeper triage is needed, temporarily raise
AO_LOG_LEVEL=info(ordebug), then revert towarn. - Monitor
lastFailureReasonand surface-levelreasonfields before enabling broader rollout.