kind: ConfigMap
apiVersion: v1
metadata:
  name: grafana-dashboard-custom-alerts-by-cluster
  namespace: open-cluster-management-observability
  labels:
    grafana-custom-dashboard: 'true'
data:
  alerts-by-cluster.json: |-
    {
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "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": true,
      "gnetId": null,
      "graphTooltip": 0,
      "id": 26,
      "iteration": 1642692464762,
      "links": [],
      "panels": [
        {
          "datasource": null,
          "description": "",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 70,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 2,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "normal"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 12,
            "x": 0,
            "y": 0
          },
          "id": 2,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltip": {
              "mode": "single"
            }
          },
          "pluginVersion": "8.1.3",
          "targets": [
            {
              "exemplar": true,
              "expr": "sum(ALERTS{alertstate=\"firing\", cluster=\"$cluster\"}) by (alertname)",
              "hide": false,
              "interval": "",
              "legendFormat": "{{cluster}}",
              "refId": "A"
            }
          ],
          "title": "${cluster} - Alerts over time",
          "type": "timeseries"
        }
      ],
      "schemaVersion": 30,
      "style": "dark",
      "tags": [],
      "templating": {
        "list": [
          {
            "allValue": null,
            "current": {
              "selected": false,
              "text": "cicd-aap-aas-ansible-a-eastus",
              "value": "cicd-aap-aas-ansible-a-eastus"
            },
            "datasource": null,
            "definition": "label_values(ALERTS, cluster)",
            "description": null,
            "error": null,
            "hide": 0,
            "includeAll": false,
            "label": "Cluster",
            "multi": false,
            "name": "cluster",
            "options": [],
            "query": {
              "query": "label_values(ALERTS, cluster)",
              "refId": "StandardVariableQuery"
            },
            "refresh": 2,
            "regex": "",
            "skipUrlSync": false,
            "sort": 5,
            "type": "query"
          }
        ]
      },
      "time": {
        "from": "now-3h",
        "to": "now"
      },
      "timepicker": {
        "refresh_intervals": [
          "5s",
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "2h",
          "1d"
        ]
      },
      "timezone": "",
      "title": "Alerts by Cluster",
      "uid": "7GMQIsJnz",
      "version": 8
    }