deploy squid on every hive host, with exporter, journal forwarding and self-check
This commit is contained in:
parent
f66b169158
commit
a2cf6fe8bb
1 changed files with 589 additions and 9 deletions
|
|
@ -187,6 +187,21 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
journalUnits = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [ "squid.service" ];
|
||||
description = ''
|
||||
Host systemd units whose journal this hive's collector forwards to
|
||||
the swarm's log store, by full unit name.
|
||||
|
||||
**A service adds its own unit, from its own module, under its own
|
||||
`enable`**, like `scrapeTargets`. The list is an allow-list on
|
||||
purpose: a hive host can be someone's workstation, so a unit that no
|
||||
module named never leaves the machine.
|
||||
'';
|
||||
};
|
||||
|
||||
clientSecretFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default =
|
||||
|
|
@ -326,6 +341,9 @@ in
|
|||
# not for agent containers.
|
||||
services.hyperhive.otel.scrapeTargets.collector = "127.0.0.1:${toString otel.telemetryPort}";
|
||||
|
||||
# The unit whose crash-watch warning a swarm-level alert reads.
|
||||
services.hyperhive.otel.journalUnits = [ "hive-c0re.service" ];
|
||||
|
||||
services.opentelemetry-collector = {
|
||||
enable = true;
|
||||
# Contrib, matching the swarm tier (./swarm-otel.nix). The upstream
|
||||
|
|
@ -449,11 +467,11 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# This tier's own host journal, scoped to the one unit whose
|
||||
# crash-watch warning (`"container crash detected"`,
|
||||
# This tier's own host journal, scoped to `journalUnits`: hive-c0re,
|
||||
# whose crash-watch warning (`"container crash detected"`,
|
||||
# `crash_watch.rs`) a swarm-level grafana alert
|
||||
# (`hh-container-crashed` in `swarm-grafana.nix`) depends on
|
||||
# reaching VictoriaLogs. Unlike the swarm tier's journald
|
||||
# reaching VictoriaLogs, plus whatever other modules name. Unlike the swarm tier's journald
|
||||
# receiver (`swarm-otel.nix`) this needs no bind mount: this
|
||||
# collector is a HOST systemd unit, not a container, so
|
||||
# `/var/log/journal` is the same filesystem hive-c0re itself
|
||||
|
|
@ -467,7 +485,7 @@ in
|
|||
journald = {
|
||||
directory = "/var/log/journal";
|
||||
storage = "file_storage";
|
||||
units = [ "hive-c0re.service" ];
|
||||
units = otel.journalUnits;
|
||||
# Severity table shared with the agent and swarm tiers'
|
||||
# journald receivers — see ../journald-severity.nix for why
|
||||
# it is its own file.
|
||||
|
|
|
|||
Loading…
Reference in a new issue