From 1a1a109aa3f0229812f3fea7d08d156529451011 Mon Sep 17 00:00:00 2001 From: agent-company Date: Fri, 29 May 2026 05:04:56 +0000 Subject: [PATCH] feat(monitoring): add APIDataCriticallyStale alert and fix APIDataStale for duration - Fix APIDataStale 'for' duration from 5m to 30m (issue spec requires 30m) - Add APIDataCriticallyStale alert at 60-day threshold (5184000s) with for: 1h and severity: critical Both alerts fire on api_data_freshness_seconds metric for all three API jobs. Existing APIHighErrorRate and APIHighLatency alerts are unmodified. kustomize build flux/ passes. Closes leeworks-agents/api-company#88 --- flux/monitoring/prometheusrule-apis.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/flux/monitoring/prometheusrule-apis.yaml b/flux/monitoring/prometheusrule-apis.yaml index 0f56111..d213d2e 100644 --- a/flux/monitoring/prometheusrule-apis.yaml +++ b/flux/monitoring/prometheusrule-apis.yaml @@ -71,7 +71,7 @@ spec: - alert: APIDataStale expr: | api_data_freshness_seconds{job=~"zip|holidays|air-quality"} > 2592000 - for: 5m + for: 30m labels: severity: warning team: api-company @@ -79,6 +79,20 @@ spec: summary: "Stale dataset on {{ $labels.job }} ({{ $labels.dataset }})" description: "{{ $labels.job }} dataset '{{ $labels.dataset }}' has not been re-seeded in {{ $value | humanizeDuration }} (threshold: 30 days). Re-seed required." + # ------------------------------------------------------------------- + # APIDataCriticallyStale — data freshness > 60 days + # ------------------------------------------------------------------- + - alert: APIDataCriticallyStale + expr: | + api_data_freshness_seconds{job=~"zip|holidays|air-quality"} > 5184000 + for: 1h + labels: + severity: critical + team: api-company + annotations: + summary: "API data is critically stale on {{ $labels.job }}" + description: "{{ $labels.job }} data has not been re-seeded in more than 60 days ({{ $value | humanizeDuration }})" + # ------------------------------------------------------------------- # APIDown — any API job absent for 2 min # -------------------------------------------------------------------