Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: move the observability concern into its own module

Refs #6897
This commit is contained in:
atlas 2026-11-27 14:21:35 +01:00
commit cd8feedf73
3 changed files with 32 additions and 27 deletions

View file

@ -1085,7 +1085,7 @@ in
# separated: a matrix user id cannot contain a space. Consumed by
# swarm-controller/src/accounts/matrix_account/operator_admin.rs.
SWARM_CONTROLLER_MATRIX_ADMIN_SYNC_IGNORE_USERS = lib.concatStringsSep " " deployCfg.swarm-controller.matrixAdminSync.ignoreUsers;
# Where `GET /api/alerts` reads alerts (swarm-controller/src/alerts.rs).
# Where `GET /api/alerts` reads alerts (swarm-controller/src/observability/alerts.rs).
# Every swarm has one Grafana, reached by name wherever it runs. The
# token is in the store, written by `swarm-bao-grafana-controller-token`
# on Grafana's host.

View file

@ -1844,7 +1844,7 @@ in
# the renewal has been stuck for days. `sender` and `agent`
# stay in the grouping so the alert names the holder.
# Agents whose deploy the build gate holds back, from the gauge
# swarm-controller exports (`held_deploys.rs`): a build that
# swarm-controller exports (`observability/held_deploys.rs`): a build that
# fails, or that keeps getting no answer from the builder. A deploy
# whose facts copy to its hive fails is held too.
# Thirty minutes covers a builder restart and the controller's

View file

@ -457,7 +457,7 @@ let
e: map lib.head (lib.filter lib.isList (builtins.split ''"(hyperhive\.vcs\.[a-z_.]+)"'' e))
) exprs
);
recordedVcs = builtins.readFile ../../swarm-controller/src/vcs_metrics.rs;
recordedVcs = builtins.readFile ../../swarm-controller/src/observability/vcs_metrics.rs;
in
lib.elem "forge.json" shipped
&& lib.elem "bao.json" shipped
@ -1143,17 +1143,17 @@ let
}
{
# The held-deploys alert fires on any agent held for 30 minutes and
# selects the gauge name `held_deploys.rs` spells in Rust. The disk rule
# selects the gauge name `observability/held_deploys.rs` spells in Rust. The disk rule
# is the presence control: it goes through the same lookup.
# 🔬 Invert-proof: change `for = "30m"` or the selector on
# `hh-deploys-held` in swarm-grafana.nix, or `METRIC` in held_deploys.rs.
# `hh-deploys-held` in swarm-grafana.nix, or `METRIC` in observability/held_deploys.rs.
name = "the held-deploys alert fires after 30 minutes on the gauge swarm-controller exports";
ok =
let
groups =
grafanaHere.containers.swarm-grafana.config.services.grafana.provision.alerting.rules.settings.groups;
rules = lib.concatMap (g: g.rules) groups;
source = builtins.readFile ../../swarm-controller/src/held_deploys.rs;
source = builtins.readFile ../../swarm-controller/src/observability/held_deploys.rs;
rule = uid: lib.findFirst (r: r.uid == uid) null rules;
held = rule "hh-deploys-held";
threshold =