feat(osint): alert when the analyst stops writing briefs #90

Merged
sirius merged 1 commit from feat/osint-analyst-freshness into master 2026-12-05 04:18:45 +00:00
Owner

Why

deploy/osint-news-summarizer wrote no article_summaries rows from 2026-11-25 03:31 UTC to 2026-12-04 while articles stayed fresh (61.5k rows, newest within minutes). Nothing noticed: container Running, restarts 0, log = INFO batch lines + INFO 404s. The nearest signal the cluster had (kube_deployment_status_replicas_available) is green for a wedged loop, so detection has to come from the data, not the pod.

The app has no /metrics (GET /metrics → 404 on osint-app), so this adds a small read-only Postgres exporter.

What

apps/base/osint/analyst-exporter.yaml — ConfigMap (stdlib HTTP server) + Deployment + Service + ServiceMonitor, namespace osint, :9187/metrics:

series source
osint_analyst_last_success_timestamp_seconds max(article_summaries.batch_timestamp)
osint_ingest_last_article_timestamp_seconds max(articles.timestamp)
osint_analyst_exporter_up 1 when the last DB read succeeded

It runs the already-pinned summarizer image (the only one here with python3 + psycopg2), so no new image build; runAsNonRoot (uid 1000), read-only rootfs, dropped caps, 10m/64Mi. On a DB error it keeps the last good values and flips up to 0, so the timestamps keep ageing instead of the series vanishing. osint_analyst_map_calls_total{status} is deliberately not added: map calls are not persisted anywhere and parsing them out of logs would be a second, fragile pipeline.

apps/base/osint/networkpolicy.yaml — one port-scoped ingress rule, monitoring → 9187. No other monitoring → osint path is opened.

monitoring/controllers/home/osint-analyst.yaml — PrometheusRule, warning, default Telegram receiver:

  • OsintAnalystStale: time() - osint_analyst_last_success_timestamp_seconds > 3600 for 30m, plus an absent() arm so a dead exporter/ServiceMonitor cannot read as healthy.
  • OsintIngestAliveButNoBrief: summary age > 2h and newest article < 2h old, for 10m — the exact ingest-fine/analyst-dark shape.

Verification

Pushed live after merge; firing + resolution evidence goes in the task completion note.

## Why `deploy/osint-news-summarizer` wrote **no** `article_summaries` rows from 2026-11-25 03:31 UTC to 2026-12-04 while `articles` stayed fresh (61.5k rows, newest within minutes). Nothing noticed: container Running, restarts 0, log = INFO batch lines + INFO 404s. The nearest signal the cluster had (`kube_deployment_status_replicas_available`) is green for a wedged loop, so detection has to come from the data, not the pod. The app has no `/metrics` (`GET /metrics` → 404 on `osint-app`), so this adds a small read-only Postgres exporter. ## What **`apps/base/osint/analyst-exporter.yaml`** — ConfigMap (stdlib HTTP server) + Deployment + Service + ServiceMonitor, namespace `osint`, `:9187/metrics`: | series | source | | --- | --- | | `osint_analyst_last_success_timestamp_seconds` | `max(article_summaries.batch_timestamp)` | | `osint_ingest_last_article_timestamp_seconds` | `max(articles.timestamp)` | | `osint_analyst_exporter_up` | 1 when the last DB read succeeded | It runs the already-pinned summarizer image (the only one here with python3 + psycopg2), so no new image build; `runAsNonRoot` (uid 1000), read-only rootfs, dropped caps, 10m/64Mi. On a DB error it keeps the last good values and flips `up` to 0, so the timestamps keep ageing instead of the series vanishing. `osint_analyst_map_calls_total{status}` is deliberately **not** added: map calls are not persisted anywhere and parsing them out of logs would be a second, fragile pipeline. **`apps/base/osint/networkpolicy.yaml`** — one port-scoped ingress rule, `monitoring` → `9187`. No other monitoring → osint path is opened. **`monitoring/controllers/home/osint-analyst.yaml`** — `PrometheusRule`, warning, default Telegram receiver: - `OsintAnalystStale`: `time() - osint_analyst_last_success_timestamp_seconds > 3600` **for 30m**, plus an `absent()` arm so a dead exporter/ServiceMonitor cannot read as healthy. - `OsintIngestAliveButNoBrief`: summary age > 2h **and** newest article < 2h old, for 10m — the exact ingest-fine/analyst-dark shape. ## Verification Pushed live after merge; firing + resolution evidence goes in the task completion note.
The 2026-11-25..12-04 outage was invisible: deploy/osint-news-summarizer
stayed Running with restarts 0 and INFO batch lines while article_summaries
froze for nine days, and the scraper kept articles fresh (61.5k rows, newest
within minutes). The app has no /metrics endpoint, so add a small read-only
Postgres exporter and two Prometheus rules.

- osint-analyst-exporter (ns osint): stdlib HTTP server on :9187 serving
  osint_analyst_last_success_timestamp_seconds (max article_summaries.
  batch_timestamp), osint_ingest_last_article_timestamp_seconds (max
  articles.timestamp) and osint_analyst_exporter_up. Runs the pinned
  summarizer image (python3 + psycopg2), non-root, read-only rootfs,
  clusterIP Service + ServiceMonitor (release=kube-prometheus-stack).
- NetworkPolicy: one port-scoped ingress rule, monitoring -> :9187. Nothing
  else in monitoring can reach osint.
- monitoring/controllers/home/osint-analyst.yaml: OsintAnalystStale
  (>1h, 30m, warning, with an absent() arm so a dead exporter cannot read as
  healthy) and OsintIngestAliveButNoBrief (articles <2h old while summaries
  >2h old, 10m, warning). Both route through the default Telegram receiver.
sirius merged commit aa8a75bdc6 into master 2026-12-05 04:18:45 +00:00
sirius deleted branch feat/osint-analyst-freshness 2026-12-05 04:18:45 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!90
No description provided.