container collectors scrape their own telemetry and push it up their hop
This commit is contained in:
parent
2095bb2d0f
commit
73c966a7eb
1 changed files with 163 additions and 49 deletions
|
|
@ -96,8 +96,9 @@ in
|
|||
type = lib.types.port;
|
||||
description = ''
|
||||
Loopback port for the collector's own metrics (refused and dropped
|
||||
records, exporter failures). Required because the container may share
|
||||
the host netns, where the binary's default 8888 is the hive tier's.
|
||||
records, exporter failures), which it scrapes and pushes to the swarm
|
||||
collector. Required because the container may share the host netns,
|
||||
where the binary's default 8888 is the hive tier's.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -242,17 +243,6 @@ in
|
|||
exporters = [ "otlphttp" ];
|
||||
};
|
||||
|
||||
# ⚠️ `readers`, not `metrics.address`: this collector version rejects
|
||||
# `address` at startup.
|
||||
service.telemetry.metrics.readers = [
|
||||
{
|
||||
pull.exporter.prometheus = {
|
||||
host = "127.0.0.1";
|
||||
port = cfg.telemetryPort;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# An extension not listed here is inert: the receiver's storage would
|
||||
# name a component that never starts, and the exporter would push
|
||||
# unauthenticated.
|
||||
|
|
@ -261,6 +251,12 @@ in
|
|||
authName
|
||||
];
|
||||
}
|
||||
(import ../collector-self-scrape.nix {
|
||||
inherit lib;
|
||||
port = cfg.telemetryPort;
|
||||
exporter = "otlphttp";
|
||||
attributes.container = cfg.serviceName;
|
||||
})
|
||||
# A separate set the module system merges in: joining it to the first with
|
||||
# `//` would replace the first set's whole `service` attrset.
|
||||
(lib.mkIf (cfg.otlpMetricsPort != null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue