Expand description
HTTP API server for operational visibility.
Provides endpoints for monitoring stargazer’s internal state, querying captured data, and manual Tier 3 session management. This is NOT the primary data consumer — the Rdio API server handles transcription downstream. The routes here exist so operators (and kubernetes health probes) can answer “is capture working?” and “what did we miss?” at a glance.
§Endpoints
| Route | Method | Purpose |
|---|---|---|
/health | GET | Kubernetes liveness/readiness probe |
/metrics | GET | Tier statistics: reflectors, streams, upload queue |
/api/reflectors | GET | List reflectors with status and activity scores |
/api/reflectors/{callsign}/activity | GET | Recent activity for one reflector |
/api/reflectors/{callsign}/nodes | GET | Nodes currently linked to a reflector |
/api/activity | GET | Recent activity across all reflectors |
/api/streams | GET | Query captured streams with filters |
/api/upload-queue | GET | Pending upload status |
/api/tier3/connect | POST | Manually promote a reflector to Tier 3 (501 stub) |
/api/tier3/{callsign}/{module} | DELETE | Disconnect a Tier 3 session (501 stub) |
§Error handling
Database errors are logged at warn level and surfaced to the caller
as 500 Internal Server Error with no body. The raw sqlx::Error is
never leaked — it can contain connection strings, schema details, or
constraint names that would be useful to an attacker.
§Operational ownership
The server is spawned by stargazer::run as a top-level tokio task.
On shutdown it is aborted; no graceful drain is attempted because all
endpoints are idempotent reads.
Modules§
- routes 🔒
- HTTP handler functions for the stargazer operational API.
Functions§
- build_
router 🔒 - Builds the axum
Routerwith all routes and shared state. - serve 🔒
- Starts the HTTP API server and listens for requests.