From d5ce39ecc6dc8f6193858066bb7f49c2a61e8fba Mon Sep 17 00:00:00 2001 From: Keith Fiske Date: Mon, 8 Jan 2024 14:33:21 -0500 Subject: [PATCH] chore: revert new grafana alertmanager dashboard --- changelogs/fragments/250.yml | 6 +- grafana/common/Prometheus_Alerts.json | 189 +++++++++++++----- grafana/common/crunchy_grafana_datasource.yml | 19 +- hugo/content/grafana/_index.md | 2 +- 4 files changed, 138 insertions(+), 78 deletions(-) diff --git a/changelogs/fragments/250.yml b/changelogs/fragments/250.yml index 92090533..2b46624c 100644 --- a/changelogs/fragments/250.yml +++ b/changelogs/fragments/250.yml @@ -1,4 +1,2 @@ ---- -major_changes: - - grafana - add Alertmanager datasource to Grafana to allow direct alert management via Grafana - - grafana - update 'Prometheus Alerts' dashboard to include new alert panel interface for active alerts +trivial: + - grafana - Reverted new Alertmanager dashboard in Grafana for now until it can be fully integrated into other Crunchy products that use it diff --git a/grafana/common/Prometheus_Alerts.json b/grafana/common/Prometheus_Alerts.json index 3a70e2ca..91bffc84 100644 --- a/grafana/common/Prometheus_Alerts.json +++ b/grafana/common/Prometheus_Alerts.json @@ -3,78 +3,164 @@ "list": [ { "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, + "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, "type": "dashboard" } ] }, "editable": false, - "fiscalYearStartMonth": 0, + "gnetId": null, "graphTooltip": 0, + "id": 8, "links": [], - "liveNow": false, "panels": [ { - "datasource": { - "type": "prometheus", - "uid": "crunchyprometheus" - }, + "columns": [], + "datasource": null, + "fontSize": "100%", "gridPos": { - "h": 8, + "h": 7, "w": 24, "x": 0, "y": 0 }, - "id": 5, - "options": { - "alertInstanceLabelFilter": "", - "alertName": "", - "dashboardAlerts": false, - "datasource": "PROMETHEUS", - "groupBy": [], - "groupMode": "default", - "maxItems": 20, - "sortOrder": 1, - "stateFilter": { - "error": true, - "firing": true, - "noData": false, - "normal": false, - "pending": true - }, - "viewMode": "list" + "id": 2, + "links": [], + "options": {}, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "type": "date" + }, + { + "alias": "", + "colorMode": "row", + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "link": false, + "mappingType": 1, + "pattern": "severity_num", + "thresholds": [ + "200", + "300" + ], + "type": "string", + "unit": "none" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "__name__", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "alertstate", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "Value", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "alert_value", + "thresholds": [], + "type": "number", + "unit": "none" + } + ], + "targets": [ + { + "expr": "ALERTS{alertstate=\"firing\"}", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 4, + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, "title": "Active Alerts", - "type": "alertlist" + "transform": "table", + "type": "table" }, { "columns": [], - "datasource": { - "type": "prometheus", - "uid": "crunchyprometheus" - }, + "datasource": null, "fontSize": "100%", "gridPos": { "h": 7, "w": 24, "x": 0, - "y": 8 + "y": 7 }, "id": 3, "links": [], + "options": {}, + "pageSize": null, "scroll": true, "showHeader": true, "sort": { @@ -84,7 +170,6 @@ "styles": [ { "alias": "Time", - "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "link": false, "pattern": "Time", @@ -92,7 +177,6 @@ }, { "alias": "", - "align": "auto", "colorMode": "row", "colors": [ "rgba(50, 172, 45, 0.97)", @@ -113,7 +197,7 @@ }, { "alias": "", - "align": "auto", + "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", @@ -129,7 +213,7 @@ }, { "alias": "", - "align": "auto", + "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", @@ -145,7 +229,7 @@ }, { "alias": "", - "align": "auto", + "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", @@ -161,7 +245,7 @@ }, { "alias": "", - "align": "auto", + "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", @@ -178,10 +262,6 @@ ], "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "crunchyprometheus" - }, "expr": "ALERTS{alertstate=\"firing\"}", "format": "table", "instant": false, @@ -194,11 +274,11 @@ "timeFrom": "1w", "title": "Alert History (1 week)", "transform": "table", - "type": "table-old" + "type": "table" } ], "refresh": "5m", - "schemaVersion": 37, + "schemaVersion": 21, "style": "dark", "tags": [], "templating": { @@ -224,6 +304,5 @@ "timezone": "", "title": "Prometheus Alerts", "uid": "QTsttxNmk", - "version": 1, - "weekStart": "" + "version": 2 } diff --git a/grafana/common/crunchy_grafana_datasource.yml b/grafana/common/crunchy_grafana_datasource.yml index daec3029..5657a880 100644 --- a/grafana/common/crunchy_grafana_datasource.yml +++ b/grafana/common/crunchy_grafana_datasource.yml @@ -7,15 +7,9 @@ # config file version apiVersion: 1 -deleteDatasources: - - name: PROMETHEUS - orgId: 1 - - name: ALERTMANAGER - orgId: 1 - datasources: - name: PROMETHEUS - uid: crunchyprometheus + uid: PDC1078F23EBDF0E5 type: prometheus access: proxy url: http://localhost:9090 @@ -23,15 +17,4 @@ datasources: editable: False orgId: 1 version: 1 - jsonData: - manageAlerts: 'true' - alertmanagerUid: 'crunchyalertmanager' - - name: ALERTMANAGER - uid: crunchyalertmanager - type: alertmanager - url: http://localhost:9093 - access: proxy - jsonData: - implementation: 'prometheus' - handleGrafanaManagedAlerts: 'false' diff --git a/hugo/content/grafana/_index.md b/hugo/content/grafana/_index.md index ffd0726c..5a572e63 100644 --- a/hugo/content/grafana/_index.md +++ b/hugo/content/grafana/_index.md @@ -35,7 +35,7 @@ pgMonitor comes with several dashboards ready to be used with automatic provisio |OS Overview | Overview.json| Provides an overview that shows the up status of each system monitored by pgMonitor. | ||| |ETCD Details | ETCD_Details.json | Provides details on the status of the ETCD cluster monitored by pgMonitor. | -|Prometheus Alerts | Prometheus_Alerts.json| Provides a summary list of current and recent alerts that have fired in Prometheus. Interaction with the Alertmanager to silence alerts is possible from the Alerting menu in Grafana. | +|Prometheus Alerts | Prometheus_Alerts.json| Provides a summary list of current and recent alerts that have fired in Prometheus. | ## Installation {#installation}