diff options
-rw-r--r-- | odin.nix | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -504,6 +504,39 @@ | |||
504 | }; | 504 | }; |
505 | }; | 505 | }; |
506 | 506 | ||
507 | services.prometheus2 = { | ||
508 | enable = true; | ||
509 | webExternalUrl = "http://odin.asgard.yggdrasil/prometheus"; | ||
510 | listenAddress = "localhost:9090"; | ||
511 | exporters = { | ||
512 | node = { | ||
513 | enable = true; | ||
514 | listenAddress = "localhost"; | ||
515 | }; | ||
516 | }; | ||
517 | scrapeConfigs = [ | ||
518 | { job_name = "router"; | ||
519 | static_configs = [ | ||
520 | { targets = [ "heimdallr:9133" ]; | ||
521 | } | ||
522 | ]; | ||
523 | } | ||
524 | { job_name = "odin"; | ||
525 | static_configs = [ | ||
526 | { targets = [ "localhost:9100" ]; | ||
527 | } | ||
528 | ]; | ||
529 | } | ||
530 | { job_name = "prometheus"; | ||
531 | metrics_path = "/prometheus/metrics"; | ||
532 | static_configs = [ | ||
533 | { targets = [ "localhost:9090" ]; | ||
534 | } | ||
535 | ]; | ||
536 | } | ||
537 | ]; | ||
538 | }; | ||
539 | |||
507 | systemd.status-mail = { | 540 | systemd.status-mail = { |
508 | recipient = "root@odin.asgard.yggdrasil"; | 541 | recipient = "root@odin.asgard.yggdrasil"; |
509 | onFailure = [ "nixos-upgrade" | 542 | onFailure = [ "nixos-upgrade" |