Skip to content

API Endpoints — KPIs

GET /api/kpis

Returns aggregated dashboard KPIs (cached 30s, sourced from Redis + materialized views).


Response

{
  "unique_events": 12500,
  "total_occurrences": 45000,
  "dedup_rate_pct": 72.2,
  "success_rate_pct": 99.8,
  "dlq_count": 12,
  "error_events": 180,
  "events_last_minute": 2100,
  "errors_last_minute": 15,
  "events_last_5min": 9800,
  "events_per_second": 165,
  "criticals_24h": 45,
  "templates_known": 3847,
  "total_applications": 8,
  "active_applications": 6,
  "inactive_applications": 2,
  "critical_applications": 1,
  "open_alerts": 3,
  "global_health_score": 72,
  "top_critical_apps": [
    {"name": "api", "critical_count": 12, "health_score": 45}
  ],
  "recent_alerts": [
    {"id": "uuid", "title": "High error rate", "severity": "P1", "created_at": "..."}
  ],
  "top_unstable_apps": [
    {"name": "worker", "error_rate_pct": 12.5}
  ],
  "top_errors": [
    {"template_id": "42", "count": 150, "template_text": "Connection timeout"}
  ],
  "sparkline": [120, 135, 128, 142, 155, 165, 158],
  "trends": {
    "events": {"1h": 1.2, "24h": 1.05},
    "errors": {"1h": -0.1, "24h": 0.2}
  }
}

KPI Definitions

KPI Source Description
unique_events mv_dashboard_aggregates Distinct events after dedup
total_occurrences Redis counter Raw message count
dedup_rate_pct Calculated (total - unique) / total * 100
success_rate_pct Calculated (written / received) * 100
dlq_count dlq_events table Failed events in last 24h
events_per_second Redis 1m counter Real-time throughput
global_health_score Computed 0–100 based on P1, dedup, ML health
top_critical_apps MV + App table Apps with most P1
sparkline Redis 1m buckets Last 7 minutes

Cache

  • Redis: aiops:events:1m, aiops:events:5m counters (TTL 30s)
  • Materialized Views: mv_dashboard_aggregates refreshed every 30s
  • API Cache: Response cached 30s in Redis