improve metrics

This commit is contained in:
Ingolf Wagner 2023-02-24 03:51:12 +01:00
parent f10610c794
commit 03d75bcc71
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
6 changed files with 38 additions and 4 deletions

View file

@ -23,13 +23,13 @@
#./jellyfin.nix
./wireguard.nix
#./tts.nix
./telegraf.nix
# logging
./loki.nix
./loki-promtail.nix
./prometheus.nix
./grafana.nix
./telegraf.nix
];

View file

@ -68,12 +68,12 @@
books = {
enable = true;
path = "/media/syncthing/books";
rescanInterval = 8 * 3600;
rescanInterval = 40 * 24 * 3600;
};
lost-fotos = {
enable = true;
path = "/media/syncthing/lost-fotos.ct";
rescanInterval = 8 * 3600;
rescanInterval = 5 * 31 * 24 * 3600;
};
movies = {
enable = true;

View file

@ -24,6 +24,10 @@ in
interval = "30m"; # agent.interval = "10s" is default
}];
http_response = [{ inherit urls; }];
processes = { };
systemd_units = { };
internet_speed.interval = "50m";
nginx.urls = [ "http://localhost/nginx_status" ];
};
};
};

View file

@ -52,6 +52,7 @@
./loki-promtail.nix
./prometheus.nix
./grafana.nix
./telegraf.nix
];

View file

@ -49,7 +49,19 @@
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
labels = {
service = "node-exporter";
server = "pepe";
server = "robi";
};
}];
}
{
# see https://www.home-assistant.io/integrations/prometheus/
job_name = "telgraf";
metrics_path = "/metrics";
static_configs = [{
targets = [ "localhost:9273" ];
labels = {
service = "telegraf";
server = "robi";
};
}];
}

View file

@ -0,0 +1,17 @@
{
services.telegraf = {
enable = true;
extraConfig = {
outputs.prometheus_client = {
listen = ":9273";
metric_version = 2;
};
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins
inputs = {
processes = { };
systemd_units = { };
nginx.urls = [ "http://localhost/nginx_status" ];
};
};
};
}