Phase 3.5 — Observability
Goal: Modern observability stack — Prometheus metrics, structured JSON logging, and Kubernetes-ready health check endpoints.
Sub-tasks
Prometheus Metrics
Structured Logging
Health Check Endpoints
Design considerations
- Prometheus metrics must have low cardinality — avoid per-instance labels where possible, use summary/histogram types
- Structured logging should be opt-in (default to existing text format for backward compatibility)
- Health endpoints should be lightweight (no DB queries for liveness)
- Consider existing
/api/health and /api/leader-check endpoints — extend, don't duplicate
Dependencies
None — can start independently.
Part of Phase 3 — Feature Direction.
Phase 3.5 — Observability
Goal: Modern observability stack — Prometheus metrics, structured JSON logging, and Kubernetes-ready health check endpoints.
Sub-tasks
Prometheus Metrics
prometheus/client_golang)/metricsendpoint with standard Go runtime metricsorchestrator_instances_discovered,orchestrator_discovery_latency_seconds,orchestrator_discovery_errors_totalorchestrator_replication_lag_seconds,orchestrator_replication_broken_totalorchestrator_recoveries_total,orchestrator_recovery_duration_seconds,orchestrator_recovery_errors_totalorchestrator_clusters_total,orchestrator_cluster_instancesorchestrator_raft_leader,orchestrator_raft_peers,orchestrator_raft_applied_indexgo/metrics/)Structured Logging
slogfrom stdlib,zerolog, orzap)golib/logcalls with structured logger (incremental migration)Health Check Endpoints
/health/live— liveness probe (process is running)/health/ready— readiness probe (backend DB connected, discovery running)/health/leader— raft leadership status (for raft deployments)Design considerations
/api/healthand/api/leader-checkendpoints — extend, don't duplicateDependencies
None — can start independently.
Part of Phase 3 — Feature Direction.