diff options
Diffstat (limited to 'hosts/atlas/prometheus.nix')
| -rw-r--r-- | hosts/atlas/prometheus.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/hosts/atlas/prometheus.nix b/hosts/atlas/prometheus.nix new file mode 100644 index 0000000..b0c3f7b --- /dev/null +++ b/hosts/atlas/prometheus.nix @@ -0,0 +1,33 @@ +{config, ...}: let + scrapeExporter = name: host: port: { + job_name = "${name}"; + static_configs = [ + { + targets = [ + "${host}:${port}" + ]; + } + ]; + }; +in { + services.prometheus = { + enable = true; + port = 5000; + exporters = { + node = { + enable = true; + enabledCollectors = ["systemd"]; + port = 5001; + }; + }; + scrapeConfigs = [ + (scrapeExporter "atlas" "127.0.0.1" "${toString config.services.prometheus.exporters.node.port}") + ]; + }; + + getchoo.server.services.promtail.clients = [ + { + url = "p-body:3030/loki/api/v1/push"; + } + ]; +} |
