From c094cf48ce2f666718a443f5fd5e332d91595dd5 Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Sat, 24 Feb 2024 08:52:01 +0100 Subject: [PATCH] Use proper prometheus url in grafana --- hosts/nixos/lapetus/services/grafana.nix | 65 ++++++++++++++---------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/hosts/nixos/lapetus/services/grafana.nix b/hosts/nixos/lapetus/services/grafana.nix index 321b554..f6f4abf 100644 --- a/hosts/nixos/lapetus/services/grafana.nix +++ b/hosts/nixos/lapetus/services/grafana.nix @@ -46,36 +46,45 @@ in enable = true; # https://grafana.com/docs/grafana/latest/alerting/set-up/provision-alerting-resources/file-provisioning/ - alerting.contactPoints.settings.contactPoints = [{ - name = "main"; - receivers = [ - { - uid = "main_discord"; - type = "discord"; - settings.url = secret "grafana_discord_webhook"; - settings.message = '' - @everyone ✨ An issue occured :O ✨ - {{ template "default.message" . }} - ''; - } - { - uid = "main_email"; - type = "email"; - settings.addresses = "colimit@moonythm.dev"; - } - ]; - }]; + alerting.contactPoints.settings = { + apiVersion = 1; + contactPoints = [{ + name = "main"; + receivers = [ + { + uid = "main_discord"; + type = "discord"; + settings.url = secret "grafana_discord_webhook"; + settings.message = '' + @everyone ✨ An issue occured :O ✨ + {{ template "default.message" . }} + ''; + } + { + uid = "main_email"; + type = "email"; + settings.addresses = "colimit@moonythm.dev"; + } + ]; + }]; + }; - alerting.policies.settings.policies = [{ - receiver = "main"; - }]; + alerting.policies.settings = { + apiVersion = 1; + policies = [{ + receiver = "main"; + }]; + }; - datasources.settings.datasources = [{ - name = "Prometheus"; - type = "prometheus"; - access = "proxy"; - url = "prometheus.moonythm.dev"; - }]; + datasources.settings = { + apiVersion = 1; + datasources = [{ + name = "Prometheus"; + type = "prometheus"; + access = "proxy"; + url = "https://prometheus.moonythm.dev"; + }]; + }; }; # }}} };