deploy: move the metrics and log store toggles
Same move as grafana, and the three belong together: they derive from one switch and a store with no UI is as useless as a UI with no store. `victorialogs` is the case that shows why the option-path sweep is not enough on its own. It has **zero** references spelled `swarm.victorialogs.enable` anywhere in the tree, and four spelled through `let` aliases (`vlCfg.enable` in the collector, `cfg.enable` in its own module). A sweep for the path would have reported nothing to do and left every reader broken. Prose moved with the code rather than being left behind: the comments in swarm-required-services.nix that explained why the pair derives together now sit above the assignments that do it, instead of above the gap where they used to be.
This commit is contained in:
parent
cf1f2f99cf
commit
29647f963e
9 changed files with 77 additions and 61 deletions
|
|
@ -59,25 +59,10 @@ in
|
|||
# the queue they authenticate against.
|
||||
nats.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
|
||||
# The metrics pair. Once per swarm and optional, so they meet the rule
|
||||
# in the option's description the same way the three above do — a hive
|
||||
# that is not the service host is a *client* of this Grafana, not a
|
||||
# second one.
|
||||
#
|
||||
# They derive together on purpose: a store with no UI is unreadable and
|
||||
# a UI with no store is empty, so there is no sensible deployment that
|
||||
# takes one and not the other from this switch. An operator who wants
|
||||
# exactly one still sets it directly, which `mkDefault` allows.
|
||||
victoriametrics.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
# (grafana's half of the pair derives below — it lives in `deploy.*`
|
||||
# now, which is a different attribute path, not a different rule.)
|
||||
|
||||
# The log store, deriving from the same switch for the same reason —
|
||||
# and deliberately in the same commit as the collector pipeline that
|
||||
# writes to it, never before it. A store nothing writes to is worse
|
||||
# than no store: it starts, answers queries, and returns nothing, so
|
||||
# the first person to look concludes there were no logs.
|
||||
victorialogs.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
# The metrics pair and the log store used to derive here too. They now
|
||||
# live under `deploy.*` (below, and ./deploy.nix) because "does THIS
|
||||
# host run it" is a per-host decision and `swarm.*` has to be identical
|
||||
# on every host. Same switch, same rule, different attribute path.
|
||||
|
||||
# The collector that feeds the pair above, and the only tier holding
|
||||
# the upstream credential. Same rule as the rest: once per swarm,
|
||||
|
|
@ -90,9 +75,16 @@ in
|
|||
# this is ./otel.nix's existing per-hive option).
|
||||
config.services.hyperhive.otel.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
|
||||
# Grafana, the UI half of the metrics pair. Same derivation and the same
|
||||
# reasoning as `victoriametrics.enable` above; it reads differently only
|
||||
# because "does this host run it" now lives in `deploy.*` (./deploy.nix)
|
||||
# rather than under `swarm.*`, which has to be identical on every host.
|
||||
# The metrics pair, deriving together on purpose: a store with no UI is
|
||||
# unreadable and a UI with no store is empty, so there is no sensible
|
||||
# deployment that takes one and not the other from this switch. An
|
||||
# operator who wants exactly one still sets it directly, which
|
||||
# `mkDefault` allows.
|
||||
#
|
||||
# The log store derives from the same switch for the same reason as the
|
||||
# rest: a hive that is not the service host is a *client* of it, not a
|
||||
# second one.
|
||||
config.services.hyperhive.deploy.victoriametrics = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.victorialogs = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.grafana = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue