gateway: send nginx stub_status to VictoriaMetrics, add a gateway dashboard
The gateway nginx serves stub_status on a loopback server of its own, 127.0.0.1:8085 (services.hyperhive.gateway.statusPort). The hive-tier collector reads it with the contrib nginx receiver, which the pinned otelcol-contrib 0.151.0 ships, so no exporter daemon is added. The receiver dials http:// only (a unix: or http+unix: endpoint fails with "unsupported protocol scheme"), so the listener is loopback TCP with allow 127.0.0.1 / deny all rather than a unix socket. The new gateway dashboard plots nginx.requests, nginx.connections_current by state, and nginx.connections_accepted against handled, per hive. Part of #5342.
This commit is contained in:
parent
e59a2a34fb
commit
f70bbda7d7
8 changed files with 460 additions and 1 deletions
|
|
@ -334,6 +334,7 @@ in
|
|||
hiveName = config.services.hyperhive.hiveName;
|
||||
listen = "${config.services.hyperhive.network.bridgeIp}:${toString otel.collector.port}";
|
||||
swarmName = "otlphttp/swarm";
|
||||
gatewayCfg = config.services.hyperhive.gateway;
|
||||
authName = "oauth2client/swarm";
|
||||
|
||||
# A hive always authenticates to the swarm's collector as itself, so
|
||||
|
|
@ -555,6 +556,15 @@ in
|
|||
job_name = job;
|
||||
static_configs = [ { targets = [ target ]; } ];
|
||||
}) otel.scrapeTargets;
|
||||
}
|
||||
# This host's gateway nginx, from the `stub_status` server
|
||||
# ./hive-gateway/default.nix adds. The receiver dials `http://`
|
||||
# only, which is why that server is on loopback TCP.
|
||||
// lib.optionalAttrs gatewayCfg.enable {
|
||||
nginx = {
|
||||
endpoint = "http://127.0.0.1:${toString gatewayCfg.statusPort}/stub_status";
|
||||
collection_interval = "60s";
|
||||
};
|
||||
};
|
||||
|
||||
# One destination, and it is the swarm's collector. This tier
|
||||
|
|
@ -662,7 +672,8 @@ in
|
|||
"otlp"
|
||||
"hostmetrics"
|
||||
]
|
||||
++ lib.optional (otel.scrapeTargets != { }) "prometheus";
|
||||
++ lib.optional (otel.scrapeTargets != { }) "prometheus"
|
||||
++ lib.optional gatewayCfg.enable "nginx";
|
||||
# Applies to EVERY receiver above, not just `hostmetrics` — a
|
||||
# processor sits in the pipeline, not on a receiver. That is
|
||||
# what we want here: samples an agent pushed over `otlp` and
|
||||
|
|
|
|||
Loading…
Reference in a new issue