CIRCE / DOCUMENTATION
Health and observability
Liveness and readiness endpoints, correlation IDs, error telemetry and latency metrics.
On this page
Health endpoints
With health: { port }, Circe serves two endpoints before login:
GET /health: liveness. Always200while the process runs.GET /ready: readiness.200only when the gateway is connected and every named check passes, otherwise503.
health: {
port: 3000,
host: "127.0.0.1",
checks: { database: () => db.ping() },
},
The server starts first and stops last, so a probe during startup sees a live process. Integrations add probes with ctx.addHealthCheck(name, check).
Correlation IDs
Every interaction runs inside an AsyncLocalStorage scope. Read the ID with getCorrelationId() or ctx.correlationId; it is attached to logs and errors.
Error reporting
onError, declared in error.ts, receives failures from commands, components, modals, context menus, events and autocomplete, tagged with an ErrorReportKind. Listener failures are isolated per listener.
Latency metrics
onInteractionComplete fires for every interaction kind with an InteractionMetric. createLatencyAccumulator() turns that stream into sliding-window p50, p95 and p99 latency, throughput, error rate and guard-denial counts.
