Watch
0
0
Fork
You've already forked hyperhive
0

leave squid's and hive-c0re's journals to the swarm tier when both run on one host

This commit is contained in:
atlas 2026-11-01 16:00:44 +01:00 • committed by mara
commit 790e242e8c
2 changed files with 44 additions and 9 deletions

View file

@ -449,7 +449,10 @@ in
services.hyperhive.network.enable = lib.mkDefault true;
services.hyperhive.otel.scrapeTargets.squid = exporterListen;
services.hyperhive.otel.journalUnits = [
# A host that also runs the swarm collector ships its whole journal
# already (./swarm-otel.nix), so naming the units there would send each
# line twice.
services.hyperhive.otel.journalUnits = lib.optionals (!hyperhiveCfg.deploy.swarm-otel.enable) [
"squid.service"
"squid-selfcheck.service"
];

View file

@ -348,11 +348,13 @@ in
# and strict refusals (`hive-priv check-rootfs`, an `ExecStartPre=` of
# the unit) and nspawn's own start failures. A host that also runs the
# swarm collector ships its whole journal already (./swarm-otel.nix), so
# naming the containers there would send each line twice.
services.hyperhive.otel.journalUnits = [
"hive-c0re.service"
]
++ lib.optionals (!config.services.hyperhive.deploy.swarm-otel.enable) [ "container@*.service" ];
# naming either there would send each line twice.
services.hyperhive.otel.journalUnits =
lib.optionals (!config.services.hyperhive.deploy.swarm-otel.enable)
[
"hive-c0re.service"
"container@*.service"
];
services.opentelemetry-collector = {
enable = true;
@ -492,6 +494,11 @@ in
# and a hive host can be someone's workstation too, so an
# allowlist is load-bearing here rather than a tidiness
# preference.
#
# Absent when no unit is named: a journald receiver with an
# empty `units` list reads every unit, not none.
}
// lib.optionalAttrs (otel.journalUnits != [ ]) {
journald = {
directory = "/var/log/journal";
storage = "file_storage";
@ -667,8 +674,8 @@ in
service.pipelines.logs = {
receivers = [
"otlp"
"journald"
];
]
++ lib.optional (otel.journalUnits != [ ]) "journald";
# `resourcedetection` and NOT `deltatocumulative`: that one is
# a metrics-only processor, and naming it here is a startup
# failure rather than a no-op. Host identity applies to both