Watch
0
0
Fork
You've already forked hyperhive
0

swarm-otel: a timer starts the receiver-socket check again while it is failed

swarm-otel-sockets probes once at activation. On a fresh swarm the
collector opens its sockets only after authelia answers, which is after
the operator unseals the store, so the probe failed and stayed failed
after ingest worked: the only red unit on the swarm.

swarm-otel-sockets-recheck.timer now starts it again each minute, and
only while it is failed (an ExecCondition on systemctl is-failed), with
a restart that does not block. The check itself gets no Restart: a
oneshot's start job stays pending through an automatic restart, so a
switch would wait on it for as long as the collector is down, and the
failed check is what the switch reports. full-setup waits for the check
to be active after the collector has recovered, and the module-eval case
pins the timer, the condition and the absence of a Restart.

Closes #6836
This commit is contained in:
maia 2026-11-24 16:36:51 +01:00
commit 912b2d9570

View file

@ -237,7 +237,12 @@ fails if a socket refuses for 30 seconds, or if a route answers `000`, `502` or
`504`, or lacks its own `X-Swarm-Otel-Route` response header, for 30 seconds.
The gateway sets that header, named after the route, on every response from a
route, so a collector that's up but not listening, or an nginx that doesn't
have the route, shows as a failed unit. Any status other than those passes,
have the route, shows as a failed unit. On a fresh swarm the unit fails at
activation, because the collector opens its sockets only once the operator has
unsealed the store. A timer, `swarm-otel-sockets-recheck`, starts the unit again
every minute while it is failed, so it turns `active` by itself once the
collector listens. systemd never restarts the unit on its own: a switch would
wait on the pending start for as long as the collector is down. Any status other than those passes,
the collector's 4xx included. A switch leaves a window of about 20 seconds in which
nginx and the container are out of step: the container stops before nginx
restarts and starts about 18 seconds after it. Senders retry through that window.
@ -267,7 +272,7 @@ swarm-otel-sockets` on the host shows whether the receiver sockets are there;
`machinectl shell swarm-otel /run/current-system/sw/bin/journalctl -u
opentelemetry-collector` shows why the collector didn't start. A collector that
keeps retrying never reaches `failed`, so `systemctl --failed` doesn't list it.
The signals are `swarm-otel-sockets` failing and the Grafana alert
The signals are `swarm-otel-sockets` not `active` and the Grafana alert
`no log records from <hive>`, which fires after about 15 minutes without a log
record stamped with that hive's `sender`.