Monitoring API¶
Health endpoints for infrastructure components (PostgreSQL, Redis), real-time collector status, and the dangerous admin-only clear-all operation.
Endpoint Summary¶
| Method | Path | Description |
|---|---|---|
GET |
/api/monitoring/health |
PostgreSQL + Redis health (latency, Redis keys) |
GET |
/api/monitoring/collectors |
Per-source status + events in last 24h |
DELETE |
/api/monitoring/clear-all |
Destroy all data (admin/superadmin only) |
System Health¶
| Field | Description |
|---|---|
postgres.status |
up / down |
postgres.latency_ms |
Round-trip SELECT 1 latency |
redis.status |
up / down |
redis.latency_ms |
PING round-trip |
redis.extra.total_keys |
Number of keys in Redis DB (dedup windows, cache) |
{
"postgres": { "status": "up", "latency_ms": 0.8, "extra": {} },
"redis": { "status": "up", "latency_ms": 0.5, "extra": { "total_keys": 4123 } }
}
Kafka is not pinged here — its health is derived from consumer lag and Vector connectivity.
Collector Status¶
For each source, returns:
| Field | Description |
|---|---|
name |
Source name |
connector |
jira, prometheus, azure-devops, custom |
status |
up if enabled + status == active, otherwise raw status |
last_event_at |
Timestamp of last ingested event |
events_24h |
Live count of events in the last 24h |
Used by the frontend to render per-collector health badges.
Clear All (Danger)¶
Irreversible
Requires role admin or superadmin. Deletes every application, source, event, alert, template and DLQ record.
Steps performed:
- Delete
events,templates,dlq_events,alerts,sources,applications - Invalidate Redis KPI cache (
kpis_global:*) REFRESH MATERIALIZED VIEW CONCURRENTLYon OLAP views (best-effort)
Returns {"status": "ok"}.
Rate limited by clear_all_limit. This endpoint intentionally requires elevated RBAC so no authenticated user can trigger it.
Related¶
- Operations / Monitoring — external monitoring setup
- KPIs API — metrics that drive the health dashboards