adjust labels in metrics

This commit is contained in:
Reid 2025-01-28 21:32:47 -08:00
parent 3d8b7cd8ae
commit b4b6ffc3b9

View file

@ -103,17 +103,23 @@ in {
}; };
}; };
scrapeConfigs = [ scrapeConfigs = let
commonLabels = {
hostname = config.networking.hostName;
};
in [
{ {
job_name = "node"; job_name = "node";
static_configs = [{ static_configs = [{
targets = [ "127.0.0.1:${toString ports.node}" ]; targets = [ "127.0.0.1:${toString ports.node}" ];
labels = commonLabels;
}]; }];
} }
{ {
job_name = "nginx"; job_name = "nginx";
static_configs = [{ static_configs = [{
targets = [ "127.0.0.1:${toString ports.nginx}" ]; targets = [ "127.0.0.1:${toString ports.nginx}" ];
labels = commonLabels;
}]; }];
} }
]; ];
@ -215,7 +221,7 @@ in {
max_age = "12h"; max_age = "12h";
labels = { labels = {
job = "systemd-journal"; job = "systemd-journal";
host = "${config.networking.hostName}"; hostname = config.networking.hostName;
}; };
}; };
relabel_configs = [ relabel_configs = [