swarm-bao: give the store's collector an explicit self-telemetry port

8890, so it stops claiming the hive collector's 8888 in the shared netns.
Extends the module-eval port case to all three tiers.
This commit is contained in:
atlas 2026-09-23 18:04:33 +02:00
commit e2ff4f5281
2 changed files with 78 additions and 8 deletions

View file

@ -1295,6 +1295,29 @@ in
Two spellings present as a healthy-looking 401.
'';
};
otel.telemetryPort = lib.mkOption {
type = lib.types.port;
default = 8890;
description = ''
Port the collector inside the store's container serves its **own**
metrics on queue depth, refused and dropped samples, exporter
failures. How you find out that telemetry is being lost, so it is
worth keeping rather than switching off.
**Deliberately neither 8888 nor 8889.** 8888 is the collector
binary's built-in default, which the hive tier
({option}`services.hyperhive.otel.telemetryPort`) already binds, and
8889 is the swarm tier's
({option}`services.hyperhive.swarm.otel.telemetryPort`). This
container runs with `privateNetwork = false`, so all three share the
host's network namespace whenever they are co-located and unlike
the OTLP ports this one appears nowhere in either config when it is
left undeclared, so nothing that compares configured ports can see
the clash. The second collector to start simply dies with
`bind: address already in use`.
'';
};
};
# ⚠️ Gated on `deploy.bao.enable`, and that is load-bearing rather than
@ -2373,6 +2396,25 @@ in
exporters = [ "otlphttp" ];
};
# Moves this collector's self-metrics off the built-in
# default of `localhost:8888`, which the hive tier holds —
# this container shares the host's netns, so leaving the
# default in place is the hive collector failing to bind.
#
# ⚠️ `metrics.address` is the spelling that looks right and
# is REJECTED by this collector version:
# `'migration.MetricsConfigV030' has invalid keys:
# address`. `readers` is the schema it accepts, and the
# difference is a startup failure rather than a warning.
service.telemetry.metrics.readers = [
{
pull.exporter.prometheus = {
host = "127.0.0.1";
port = cfg.otel.telemetryPort;
};
}
];
# An extension configured but not listed here is INERT — the
# receiver's `storage: file_storage` above would name a
# component the collector never starts, and the exporter's