mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
services/netdata: Added to prometheus stack
This commit is contained in:
parent
f7f116a9a8
commit
7d701506ce
5 changed files with 48 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ with lib;
|
|||
../../../services/loki.nix
|
||||
../../../services/node-exporter.nix
|
||||
../../../services/promtail.nix
|
||||
../../../services/netdata.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ in {
|
|||
../../../services/nginx.nix
|
||||
../../../services/node-exporter.nix
|
||||
../../../services/promtail.nix
|
||||
../../../services/netdata.nix
|
||||
./thermal
|
||||
./transmission.nix
|
||||
./jellyfin.nix
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ with lib;
|
|||
../../../services/restic.nix
|
||||
../../../services/node-exporter.nix
|
||||
../../../services/promtail.nix
|
||||
../../../services/netdata.nix
|
||||
../../../services/nginx.nix
|
||||
profiles.gui
|
||||
profiles.sway
|
||||
profiles.kat
|
||||
|
|
|
|||
24
services/netdata.nix
Normal file
24
services/netdata.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
katnet.private.tcp.ports = [ 19999 ];
|
||||
|
||||
services.netdata = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.nginx = {#
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"${config.networking.hostName}.net.kittywit.ch" = {
|
||||
useACMEHost = "${config.networking.hostName}.net.kittywit.ch";
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
"/netdata" = {
|
||||
proxyPass = "http://[::1]:19999/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -8,6 +8,11 @@ let
|
|||
(filterAttrs
|
||||
(_: host: host.config.services.prometheus.exporters.node.enable)
|
||||
hosts));
|
||||
nd_configs =
|
||||
(mapAttrs (hostName: host: host.config.services.netdata)
|
||||
(filterAttrs
|
||||
(_: host: host.config.services.netdata.enable)
|
||||
hosts));
|
||||
in {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
|
|
@ -17,9 +22,23 @@ in {
|
|||
static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ];}];
|
||||
}
|
||||
] ++ mapAttrsToList (hostName: prom: {
|
||||
job_name = "${hostName}-nd";
|
||||
metrics_path = "/api/v1/allmetrics";
|
||||
honor_labels = true;
|
||||
params = {
|
||||
format = [ "prometheus" ];
|
||||
};
|
||||
static_configs = [{
|
||||
targets = [
|
||||
"${hostName}.net.kittywit.ch:19999"
|
||||
];
|
||||
}];
|
||||
}) nd_configs ++ mapAttrsToList (hostName: prom: {
|
||||
job_name = hostName;
|
||||
static_configs = [{
|
||||
targets = [ "${hostName}.net.kittywit.ch:${toString prom.port}" ];
|
||||
targets = [
|
||||
"${hostName}.net.kittywit.ch:${toString prom.port}"
|
||||
];
|
||||
}];
|
||||
}) prom_configs;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue