Repository navigation
feat(server): operator health, readiness, and telemetry endpoints - #113
Merged
Merged
Conversation
Machine-readable liveness (/api/health), readiness (/api/ready), and runtime telemetry (/api/telemetry) on the operator mux behind the existing operator guard. Per-listener status, sanitized last-error class, active agent count, queue depth, and recent task/build failure indicators with documented healthy/degraded/failing semantics. Refs #102
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #102: machine-readable operator health surface, all routes GET-only JSON on the operator mux behind the existing operator guard (loopback or operator token).
GET /api/health— liveness:{status, uptime_seconds}, always 200, zero I/O.GET /api/ready— readiness: storage probe (SELECT 1); 200 ready / 503 not_ready; no DB configured →disabled(ready).GET /api/telemetry— runtime summary: per-listener status, sanitizedlast_error_class, active agents, queue depth, recent task/build failure counters (1h window), aggregate server health.Semantics (documented in
docs/health-telemetry.md): listener = failing on ERROR status or unreadable telemetry (never fabricated zeros), degraded on recent task/build failures while ACTIVE, else healthy; STOPPED is deliberate and never degrades. Server status = worst listener health, failing on storage unavailable.Security: raw listener errors (cert paths, bind addresses, TLS internals) are classified into fixed categories; no agent IDs, paths, secrets, or raw error strings in responses. Telemetry reads existing runtime state (listener snapshots, agent registry, task stores, one aggregate query over
payload_builds) — no competing source of truth.Tests
8 new tests: liveness, readiness (3 storage states + 405), healthy listener, errored-and-sanitized listener, degraded listener (full dispatch→failed lifecycle), windowed build failures, storage-unavailable → failing, error-class table test.
go build/vet/test ./...and gofmt all green.Closes #102