feat(multiplayer): expose allocator quota metrics

This commit is contained in:
Josh Creek
2026-09-01 18:43:55 +01:00
parent fc000e71d5
commit 9a72dd5eab
8 changed files with 254 additions and 5 deletions
+3 -1
View File
@@ -40,7 +40,7 @@ def verify(directory: Path, service_path: Path) -> None:
if "kind: PrometheusRule" not in rules:
raise ValueError("PrometheusRule resource is missing")
for alert in ("CosmicClashControlPlaneAPIP95High", "CosmicClashControlPlaneAPI5xxHigh"):
for alert in ("CosmicClashControlPlaneAPIP95High", "CosmicClashControlPlaneAPI5xxHigh", "CosmicClashAllocatorQuotaDenials"):
if f"alert: {alert}" not in rules:
raise ValueError(f"required alert is missing: {alert}")
if "histogram_quantile" not in rules or "cosmic_clash_api_latency_seconds_bucket" not in rules:
@@ -49,6 +49,8 @@ def verify(directory: Path, service_path: Path) -> None:
raise ValueError("API error alert is not based on the exported counter")
if "severity: page" not in rules or "owner: api" not in rules:
raise ValueError("alerts must have bounded routing labels")
if "cosmic_clash_allocator_quota_denials_total" not in rules or "owner: allocator" not in rules:
raise ValueError("allocator quota alert is not based on bounded allocator metrics")
routing = rules.split("labels:", 1)[-1].split("annotations:", 1)[0]
if "{{ $labels." in routing:
raise ValueError("dynamic labels were added to alert routing")