Watch
1
0
Fork
You've already forked RedFlag
0
RedFlag/server/internal/observability
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Fimeg f7882241c7 give the system a window you can scrape, and patch a migration that couldn't run twice
OBS-001A: an authenticated /metrics so something other than a human reading
logs can watch the box. no new dep — emits prometheus text straight from the
counters we already keep:

- /metrics behind a dedicated bearer token (sha-256 hash stored, plaintext only
  from REDFLAG_METRICS_TOKEN for bootstrap). constant-time compare, rotates
  without a restart, disabled by default, never an open route
- exports db pool, taskrunner snapshot, scheduler + queue, breaker state, and
  the deferred-advisory count — read live on each scrape, bounded labels only
- settings + migration 054 for observability.metrics_enabled / _token_hash

also fixed migration 046 — it added a column and an index without IF NOT EXISTS
and backfilled off a column it then drops, so it couldn't survive a second run.
guarded every step; the idempotency lint is green again. only the migrations
the runner hasn't recorded see the change, so live dbs don't care.

builds clean, vet quiet, new tests pass.
2026-06-07 20:59:29 -04:00
..
metrics.go give the system a window you can scrape, and patch a migration that couldn't run twice 2026-06-07 20:59:29 -04:00
metrics_test.go give the system a window you can scrape, and patch a migration that couldn't run twice 2026-06-07 20:59:29 -04:00