From 3637a81cb5a0a5ba0da2478050994c742ee2f727 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 6 May 2019 20:34:13 +0200 Subject: Prometheus on odin --- odin.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/odin.nix b/odin.nix index 294c4d09..725c07ac 100644 --- a/odin.nix +++ b/odin.nix @@ -504,6 +504,39 @@ }; }; + services.prometheus2 = { + enable = true; + webExternalUrl = "http://odin.asgard.yggdrasil/prometheus"; + listenAddress = "localhost:9090"; + exporters = { + node = { + enable = true; + listenAddress = "localhost"; + }; + }; + scrapeConfigs = [ + { job_name = "router"; + static_configs = [ + { targets = [ "heimdallr:9133" ]; + } + ]; + } + { job_name = "odin"; + static_configs = [ + { targets = [ "localhost:9100" ]; + } + ]; + } + { job_name = "prometheus"; + metrics_path = "/prometheus/metrics"; + static_configs = [ + { targets = [ "localhost:9090" ]; + } + ]; + } + ]; + }; + systemd.status-mail = { recipient = "root@odin.asgard.yggdrasil"; onFailure = [ "nixos-upgrade" -- cgit v1.2.3