Skip to content

feat(server): operator health, readiness, and telemetry endpoints - #113

Merged
Darkroom4364 merged 1 commit into
devfrom
codex/102-health-telemetry
Jul 25, 2026
Merged

Darkroom4364 merged 1 commit into
devfrom
codex/102-health-telemetry

Conversation

@Darkroom4364

Copy link
Copy Markdown
Owner

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, sanitized last_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

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
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f198fbe-e10b-41ef-a203-80a907dd5a0c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/102-health-telemetry

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Darkroom4364
Darkroom4364 merged commit 2c52d70 into dev Jul 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant