nixos-config/configs/workhorse/prometheus.nix

108 lines
2.4 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
{
services.nginx = {
enable = true;
statusPage = true;
virtualHosts = {
"prometheus.workhorse.private" = {
locations."/" = {
proxyPass = "http://workhorse.private:9090";
};
};
};
};
services.prometheus = {
2019-10-24 02:20:38 +02:00
enable = true;
scrapeConfigs = [
{
job_name = "nginx";
scrape_interval = "8s";
static_configs = [
{
targets = ["sputnik.private:9113"];
labels = {
service = "nginx";
server = "sputnik";
};
}
{
targets = ["sputnik.private:9113"];
labels = {
service = "nginx";
server = "sputnik";
};
}
{
targets = ["workhorse.private:9113"];
labels = {
service = "nginx";
server = "sputnik";
};
}
];
}
{
job_name = "netdata";
metrics_path = "/api/v1/allmetrics";
params.format = [ "prometheus" ];
scrape_interval = "5s";
static_configs = [
{
targets = ["porani.private:19999"];
labels = {
service = "netdata";
server = "porani";
};
}
{
targets = ["sputnik.private:19999"];
labels = {
service = "netdata";
server = "sputnik";
};
}
{
targets = ["workhorse.private:19999"];
labels = {
service = "netdata";
server = "workhorse";
};
}
];
}
{
job_name = "gogs";
metrics_path = "/-/metrics";
params.format = [ "prometheus" ];
scrape_interval = "10s";
static_configs = [
{
targets = ["workhorse.private:3000"];
labels = {
service = "gogs";
server = "kruck";
};
}
];
}
{
job_name = "home-assistant";
scrape_interval = "60s";
metrics_path = "/api/prometheus";
static_configs = [
{
targets = ["porani.private:8123"];
labels = {
service = "hass";
server = "porani";
city = "essen";
};
}
];
}
];
};
}