adjust labels in metrics
This commit is contained in:
parent
3d8b7cd8ae
commit
b4b6ffc3b9
1 changed files with 8 additions and 2 deletions
|
@ -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 = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue