1
0
Fork 0
nixos-config/system/monitoring/prometheus.nix
2020-05-07 18:53:11 +02:00

30 lines
759 B
Nix

{ config, ... }: {
services = {
prometheus = {
enable = true;
extraFlags =
[ "--query.lookback-delta 2h" "--storage.tsdb.retention.time 720d" ];
exporters = {
blackbox = {
enable = true;
configFile = ./blackbox_rules.yml;
};
};
ruleFiles = [ ./rules.yml ];
scrapeConfigs = [
{
job_name = "matrix";
metrics_path = "/_synapse/metrics";
static_configs = [{ targets = [ "localhost:9148" ]; }];
}
{
job_name = "nodes";
static_configs = map (entry: {
targets = [ entry.host ];
labels = { "name" = entry.name; };
}) config.m-0.monitoring;
}
];
};
};
}