miroir/crates
jedarden 57e6239d7e P2.1: Implement axum server skeleton with health/version/ready/topology/shards/metrics endpoints
Implemented the minimum-viable endpoints needed for Kubernetes probes and operator inspection:

- Config loading: file → env → CLI overlay with validation
- JSON structured logging to stdout (plan §10 format)
- Two axum listeners: :7700 (client API) + :9090 (metrics, unauthenticated)
- Signal handlers for graceful shutdown (SIGTERM drains in-flight requests)

Endpoints implemented:
- GET /health - Meilisearch-compatible liveness probe (200, no auth, returns {"status":"available"})
- GET /version - Returns Meilisearch version from any healthy node (60s TTL cache)
- GET /_miroir/ready - Readiness probe (503 until covering quorum reachable)
- GET /_miroir/topology - Full cluster state per plan §10 JSON shape
- GET /_miroir/shards - Shard → node mapping table
- GET /_miroir/metrics - Admin-key-gated Prometheus metrics mirror

Acceptance criteria verified:
- curl localhost:7700/health returns 200 within 100ms of process start ✓
- curl localhost:7700/_miroir/ready returns 503 until all nodes reachable ✓
- curl -H "Authorization: Bearer $ADMIN_KEY" localhost:7700/_miroir/topology matches plan §10 shape ✓
- SIGTERM drains in-flight requests ✓

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 05:52:21 -04:00
..
miroir-core Integrate MeilisearchError into proxy (IntoResponse, auth middleware) + telemetry 2026-04-19 05:21:09 -04:00
miroir-ctl P0.7: Fix cargo fmt and clippy warnings for CI smoke 2026-04-18 22:06:56 -04:00
miroir-proxy P2.1: Implement axum server skeleton with health/version/ready/topology/shards/metrics endpoints 2026-04-19 05:52:21 -04:00