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";
static_configs = [{
targets = [ "127.0.0.1:${toString ports.node}" ];
labels = commonLabels;
}];
}
{
job_name = "nginx";
static_configs = [{
targets = [ "127.0.0.1:${toString ports.nginx}" ];
labels = commonLabels;
}];
}
];
@ -215,7 +221,7 @@ in {
max_age = "12h";
labels = {
job = "systemd-journal";
host = "${config.networking.hostName}";
hostname = config.networking.hostName;
};
};
relabel_configs = [