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
|
|
@ -72,6 +72,11 @@ let
|
|||
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE = "cumulative";
|
||||
};
|
||||
|
||||
# Where the collector serves its own metrics, inside the container's own
|
||||
# netns. Not the binary's default 8888, which the collector dashboard
|
||||
# reads as the hive collector's.
|
||||
selfTelemetryPort = 8904;
|
||||
|
||||
# The exporter's NAME picks the wire protocol, so `protocol` has to be
|
||||
# read here as well as handed to the SDKs above — same expression as the
|
||||
# swarm tier's upstream exporter in nix/host-modules/swarm-otel.nix.
|
||||
|
|
@ -296,5 +301,14 @@ in
|
|||
service.extensions = [ "file_storage" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Every agent container has a network namespace of its own, so they can all
|
||||
# use the same port.
|
||||
services.opentelemetry-collector.settings = import ../collector-self-scrape.nix {
|
||||
inherit lib;
|
||||
port = selfTelemetryPort;
|
||||
exporter = logExporter;
|
||||
attributes.agent = userName;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue