forked from the-distro/infra
emilylange
8d2a367e92
This allows us to use multiple jobs, one for each additional exporter, and set their `job_name` accordingly. `job_name` is exported as `job` label on the resulting metrics. This allows us to quickly get an understanding what metrics of an exporter are actually available by simply filtering all metrics by `{job="$jobname"}`
22 lines
473 B
Nix
22 lines
473 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.bagel.monitoring.exporters.cadvisor;
|
|
inherit (lib) mkEnableOption mkIf;
|
|
in
|
|
{
|
|
options.bagel.monitoring.exporters.cadvisor.enable = (mkEnableOption "Standard cAdvisor") // { default = !config.boot.isContainer; };
|
|
|
|
config = mkIf cfg.enable {
|
|
services.cadvisor = {
|
|
enable = true;
|
|
port = 9102;
|
|
listenAddress = "0.0.0.0";
|
|
};
|
|
|
|
bagel.monitoring.grafana-agent.exporters.cadvisor.port = 9102;
|
|
};
|
|
}
|