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:
parent
870a0a6697
commit
912b2d9570
1 changed files with 72 additions and 2 deletions
|
|
@ -900,6 +900,33 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
# On a fresh swarm the collector opens its sockets only after authelia
|
||||
# answers, which is after the operator unseals the store, long after the
|
||||
# check's one attempt at activation. The check stays failed, which is what
|
||||
# the switch reports, so it is not given a restart of its own: a oneshot's
|
||||
# start job stays pending through an automatic restart, and the switch
|
||||
# would wait on it for as long as the collector is down. This timer starts
|
||||
# the check again each minute while, and only while, it is failed. The
|
||||
# restart does not block, so a check that fails again leaves nothing
|
||||
# waiting.
|
||||
systemd.services.swarm-otel-sockets-recheck = {
|
||||
description = "start the swarm collector socket check again while it is failed";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
# Exit 1 (the check is not failed) skips the start and is no failure.
|
||||
ExecCondition = "${pkgs.systemd}/bin/systemctl is-failed --quiet swarm-otel-sockets.service";
|
||||
ExecStart = "${pkgs.systemd}/bin/systemctl restart --no-block swarm-otel-sockets.service";
|
||||
};
|
||||
};
|
||||
systemd.timers.swarm-otel-sockets-recheck = {
|
||||
description = "start the swarm collector socket check again while it is failed";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnActiveSec = "1min";
|
||||
OnUnitActiveSec = "1min";
|
||||
};
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
# Shaped after ./swarm-grafana.nix's `haveClientIdentity` assertion —
|
||||
|
|
|
|||
Loading…
Reference in a new issue