about summary refs log tree commit diff
path: root/modules/nixos/monitoring
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-03-16 03:35:21 +0300
committerAzat Bahawi <azat@bahawi.net>2023-03-16 03:35:21 +0300
commitb4ea4daa0699d4e95eb6f70be740203d7f4d6058 (patch)
tree432c3101153ae3bb98df4627f32339ef209acb1e /modules/nixos/monitoring
parent2023-03-16 (diff)
2023-03-16
Diffstat (limited to 'modules/nixos/monitoring')
-rw-r--r--modules/nixos/monitoring/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/nixos/monitoring/default.nix b/modules/nixos/monitoring/default.nix
index a48701e..1108be6 100644
--- a/modules/nixos/monitoring/default.nix
+++ b/modules/nixos/monitoring/default.nix
@@ -70,6 +70,40 @@ in {
             options.path = ./dashboards/postgresql.json;
           }
         ];
+
+        alerting = {
+          contactPoints.settings.contactPoints = [
+            {
+              name = "Alertmanager";
+              receivers = [
+                {
+                  uid = 1;
+                  type = "prometheus-alertmanager";
+                  settings.url = "https://${config.nixfiles.modules.alertmanager.domain}";
+                }
+              ];
+            }
+          ];
+          muteTimings.settings.muteTimes = [
+            {
+              name = "Sleep";
+              time_intervals = [
+                {
+                  times = [
+                    {
+                      start_time = "23:00";
+                      end_time = "24:00";
+                    }
+                    {
+                      start_time = "00:00";
+                      end_time = "09:00";
+                    }
+                  ];
+                }
+              ];
+            }
+          ];
+        };
       };
 
       loki.configuration.ruler.alertmanager_url = "https://${config.nixfiles.modules.alertmanager.domain}";

Consider giving Nix/NixOS a try! <3