otel: agents reach their hive's collector by a swarm-wide name
Agents are handed `http://hive-collector.<swarm domain>:<port>` as their otel endpoint instead of `http://<bridge IP>:<port>`. Every hive running its collector contributes the name to `gateway.localNames`, so its own dnsmasq answers it with its bridge IP, the way the queue's name already works. The rendered meta flake then carries no hive-specific address, which a swarm-level render needs (#4857, operator ruling 100744: "b"). hive-c0re's own exporter keeps the bridge address: on the host the name may resolve to loopback through `gateway.localHostsEntry`, where the receiver does not listen. The name sits under the swarm domain and starts with `hive`, a fragment no hive name may contain, so no hive's default domain can take it.
This commit is contained in:
parent
db4bfd4007
commit
d4e20803ec
6 changed files with 58 additions and 13 deletions
|
|
@ -199,6 +199,20 @@ let
|
|||
&& !(lib.hasInfix "127.0.0.1" e.HIVE_AGENT_NATS_URL)
|
||||
&& e.HIVE_AGENT_NATS_URL == e.HIVE_C0RE_NATS_URL;
|
||||
}
|
||||
{
|
||||
# What agents are handed lands in their builds, so it has to be the same
|
||||
# on every hive: a name, which this hive's resolver answers with the
|
||||
# bridge IP its collector binds. hive-c0re itself keeps the address.
|
||||
name = "the agents' collector address is a swarm-wide name this hive resolves to its bridge";
|
||||
ok =
|
||||
let
|
||||
e = allLocal.systemd.services.hive-c0re.environment;
|
||||
bridge = allLocal.services.hyperhive.network.bridgeIp;
|
||||
in
|
||||
e.HYPERHIVE_OTEL_ENDPOINT == "http://hive-collector.t.local:4318"
|
||||
&& e.OTEL_EXPORTER_OTLP_ENDPOINT == "http://${bridge}:4318"
|
||||
&& lib.elem "/hive-collector.t.local/${bridge}" allLocal.services.dnsmasq.settings.address;
|
||||
}
|
||||
{
|
||||
# The agents mint against the swarm's IdP, the same endpoint the hive's
|
||||
# own client uses — a hive-local guess would produce a token the queue
|
||||
|
|
|
|||
Loading…
Reference in a new issue