Skip to main content

Fleet API

Prefix: /api/fleet | Tag: fleet

Unified fleet health scoring. Replaces the separate health/risk endpoints with a single data source from byoc_agent.unified_scorer. Results are cached for 60 seconds.

Endpoints

MethodPathDescription
GET/api/fleet/scoresAll cluster scores (unified view)
GET/api/fleet/kpisFleet-wide KPI summary
GET/api/fleet/criticalWarning + Critical clusters only
GET/api/fleet/rulesUnified scoring rules
POST/api/fleet/refreshRecompute unified scores

GET /api/fleet/scores

Returns all clusters scored by the unified scorer, sorted worst-first.

Response:

{
"scores": [
{
"cluster_id": "uuid",
"cluster_name": "prod-analytics",
"customer_name": "Acme Corp",
"account_id": "abc123",
"customer_tier": "S",
"overall_score": 42.5,
"metrics_score": 38.0,
"alerts_score": 55.0,
"tier_adjusted_score": 40.0,
"classification": "Critical",
"top_risk": "Compaction: 35",
"cluster_type": "ELASTIC",
"region": "US East (N. Virginia) us-east-1",
"dimension_scores": [
{"name": "Compaction Score", "score": 35.0, "value": 8500.0, "weight": 0.2, "status": "critical"}
],
"risk_reasons": ["High compaction score"],
"suggested_actions": ["Investigate compaction backlog"],
"firing_alert_count_7d": 12,
"metrics": {
"compaction_score": 8500.0,
"disk_used_pct": 82.3,
"query_errors_7d": 350,
"query_error_pct": 1.2,
"qps": 45.2,
"node_count": 5
}
}
],
"source": "unified",
"generated_at": "..."
}

GET /api/fleet/kpis

Response:

{
"kpis": {
"total_clusters": 172,
"healthy_count": 150,
"warning_count": 15,
"critical_count": 7,
"avg_score": 78.3,
"avg_metrics_score": 75.0,
"avg_alerts_score": 82.0,
"tier_s_at_risk": 2
},
"source": "unified",
"generated_at": "..."
}

GET /api/fleet/critical

Returns only Warning and Critical clusters, sorted worst-first.

GET /api/fleet/rules

Returns the unified scoring rules from byoc_agent/unified_rules.yaml.

Response:

{
"lookback_days": 7,
"weights": { "metrics": 0.7, "alerts": 0.3 },
"tier_multipliers": { "S": 1.2, "A": 1.0, "B": 0.8 },
"alert_bands": [...],
"classification": { "healthy": 75, "warning": 40 },
"ai_trigger": {...},
"dimensions": [
{
"metric_key": "compaction_score",
"display_name": "Max Compaction Score",
"category": "storage",
"weight": 0.2,
"green": 200,
"yellow": 1000,
"red": 5000,
"inverted": false,
"action": "Investigate compaction backlog"
}
]
}

POST /api/fleet/refresh

Recomputes unified scores: loads rules, computes scores, persists, clears cache.

Response:

{
"status": "ok",
"clusters_scored": 172,
"critical": 7,
"warning": 15
}