Watch
0
0
Fork
You've already forked hyperhive
0

swarm-otel: scrape the authenticated targets only once the collector has its client secret

An empty secret file made the prometheus receiver request a token for each published target every scrape; authelia's per-address limit then refused every client behind that address. Without a secret the collector starts on the config minus those jobs. full-setup asserts the limiter never fired.
This commit is contained in:
atlas 2026-11-23 12:15:37 +01:00 • committed by mara
commit 480855dfaf

View file

@ -65,6 +65,18 @@ the client it reads for unconditionally: authelia refuses a
bearer-authz client with no audience, and every host publishes at least
forgejo's `/metrics` as a scrape target, so the audience is never empty.
Until the store answers, the collector's secret file is empty: tmpfiles creates
it so `LoadCredential` has a source. The collector's unit starts through a
wrapper that checks that file. On an empty one it loads the config without the
`publishedScrapeTargets` jobs, so it still receives and still scrapes its own
loopback targets, but asks authelia for no token. The prometheus receiver reads
the secret file on every scrape and requests a token even when it's empty. One
refused request per published target per minute would drain the token
endpoint's per-address rate limit and make authelia answer 429 to every other
client of that address. The exporters already refuse an empty secret without
sending anything. When `swarm-bao-otel-oidc.service` writes the secret it
restarts the running collector, and the restart loads the full config.
⚠️ **A collector with no store identity isn't refused.** Unlike Grafana,
where an absent OIDC block is a container with no way in at all, a collector
with nothing to authenticate with still receives every hive's telemetry —