From 595e52feb2d46db73c05b6627c3ce2c50ee92e85 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Fri, 27 Oct 2023 14:55:04 +0100 Subject: [PATCH] Update monitoring targets, internet speed alerts --- nix/monitoring/configuration.nix | 54 ++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/nix/monitoring/configuration.nix b/nix/monitoring/configuration.nix index 4eb953f..548601b 100644 --- a/nix/monitoring/configuration.nix +++ b/nix/monitoring/configuration.nix @@ -198,22 +198,39 @@ } ]; } ]; rules = [(builtins.toJSON { - groups = [{ - name = "healthchecks"; - rules = [ - { - alert = "HealthcheckFailedCheckin"; - expr = ''hc_check_up < 1''; - for = "5m"; - labels.severity = "page"; - annotations = { - summary = "{{ $labels.name }} healthcheck failed"; - description = "The {{ $labels.name }} healthcheck failed to check in."; - dashboard = "f594ea85-45f2-4019-b988-2d17638b5cf3"; - }; - } - ]; - }]; + groups = [ + { + name = "internet_connection"; + rules = [ + { + alert = "LowInternetDownload"; + expr = ''speedtest_download_bits_per_second{} < 500000000''; + for = "2h"; + labels.severity = "page"; + annotations = { + summary = "Internet speed low"; + description = "Home internet speed dropped below 500Mb/s."; + dashboard = "o9mIe_Aik"; + }; + } + ]; + } + { + name = "healthchecks"; + rules = [ + { + alert = "HealthcheckFailedCheckin"; + expr = ''hc_check_up < 1''; + for = "5m"; + labels.severity = "page"; + annotations = { + summary = "{{ $labels.name }} healthcheck failed"; + description = "The {{ $labels.name }} healthcheck failed to check in."; + dashboard = "f594ea85-45f2-4019-b988-2d17638b5cf3"; + }; + } + ]; + }]; })]; alertmanager = { enable = true; @@ -272,6 +289,11 @@ metrics_path = "/projects/5f1de50f-a52d-4215-961f-aae7cc6cf6c9/metrics/TbMoU7SUdknzMe-H5Q4HzmKl3itOIrJk"; static_configs = [ { targets = [ "localhost:8000" ]; } ]; } + { + job_name = "vrc_events"; + scrape_interval = "60s"; + static_configs = [ { targets = [ "vancouver:6534" ]; } ]; + } { job_name = "blackbox"; metrics_path = "/probe";