From 0b68d2f96a8edf1285e808453847a49d8e27f9e6 Mon Sep 17 00:00:00 2001 From: Kristian Klausen <kristian@klausen.dk> Date: Sat, 16 Oct 2021 20:19:40 +0200 Subject: [PATCH] grafana: Enable Unified Alerting and wire up with alertmanager Grafana v8.2.0 added support for Prometheus's Alertmanager[1] which can be used with the Unified Alerting added in v8.0.0[2]. [1] https://github.com/grafana/grafana/releases/tag/v8.2.0 [2] https://grafana.com/blog/2021/06/08/grafana-8.0-unified-grafana-and-prometheus-alerts-live-streaming-new-visualizations-and-more/ --- roles/grafana/templates/datasources.yaml.j2 | 8 ++++++++ roles/grafana/templates/grafana.ini.j2 | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/grafana/templates/datasources.yaml.j2 b/roles/grafana/templates/datasources.yaml.j2 index c71602cb0..5189f57c4 100644 --- a/roles/grafana/templates/datasources.yaml.j2 +++ b/roles/grafana/templates/datasources.yaml.j2 @@ -19,4 +19,12 @@ datasources: type: loki access: proxy url: http://localhost:3100 + jsonData: + manageAlerts: false +- name: Alertmanager + type: alertmanager + access: proxy + url: http://localhost:9093 + jsonData: + implementation: prometheus {% endif %} diff --git a/roles/grafana/templates/grafana.ini.j2 b/roles/grafana/templates/grafana.ini.j2 index c9bd9a057..e0103243a 100644 --- a/roles/grafana/templates/grafana.ini.j2 +++ b/roles/grafana/templates/grafana.ini.j2 @@ -716,7 +716,7 @@ mode = syslog #################################### Unified Alerting #################### [unified_alerting] #Enable the Unified Alerting sub-system and interface. When enabled we'll migrate all of your alert rules and notification channels to the new system. New alert rules will be created and your notification channels will be converted into an Alertmanager configuration. Previous data is preserved to enable backwards compatibility but new data is removed.``` -;enabled = false +enabled = true # Comma-separated list of organization IDs for which to disable unified alerting. Only supported if unified alerting is enabled. ;disabled_orgs = @@ -940,7 +940,7 @@ enabled = false ;disable_sanitize_html = false [plugins] -;enable_alpha = false +enable_alpha = true ;app_tls_skip_verify_insecure = false # Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded. ;allow_loading_unsigned_plugins = -- GitLab