- updates - snapserver - graphana dashboards - loki - ddclient - arr suite, jellyseer - mautrix fixes
42 lines
941 B
Nix
42 lines
941 B
Nix
{config, ...}: let
|
|
inherit (config.services) prometheus;
|
|
nodes = [
|
|
"alpine"
|
|
"fcs-tristan-nixbook"
|
|
"zenix"
|
|
];
|
|
addPort = ip: "${ip}:${toString prometheus.exporters.node.port}";
|
|
in {
|
|
services.prometheus = {
|
|
enable = true;
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "nodes";
|
|
static_configs = [
|
|
{
|
|
targets = builtins.map addPort nodes;
|
|
}
|
|
];
|
|
}
|
|
{
|
|
job_name = "prometheus";
|
|
static_configs = [
|
|
{
|
|
targets = ["localhost:${toString config.services.prometheus.exporters.postgres.port}"];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
exporters = {
|
|
postgres = {
|
|
enable = true;
|
|
runAsLocalSuperUser = true;
|
|
};
|
|
};
|
|
};
|
|
services.grafana.provision.datasources.settings.datasources = [{
|
|
name = "Prometheus";
|
|
type = "prometheus";
|
|
url = "http://localhost:${toString prometheus.port}";
|
|
}];
|
|
}
|