apiVersion: v1
kind: ConfigMap
metadata:
  name: event-bus-dashboard
  labels:
    grafana_dashboard: "1"
    app: monitoring-grafana
data:
  event-bus-dashboard.json: |-
    {
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": "-- Grafana --",
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "type": "dashboard"
          }
        ]
      },
      "editable": false,
      "gnetId": null,
      "graphTooltip": 0,
      "iteration": 1557234230484,
      "links": [],
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "description": "Rate of published events per {namespace $| \nsource ID &| event type &| event type version} per minute",
          "fill": 1,
          "gridPos": {
            "h": 12,
            "w": 21,
            "x": 0,
            "y": 0
          },
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "paceLength": 10,
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "irate(total_published_messages{namespace=~\"$namespace\",event_type=~\"$event_type\",event_type_version=~\"$event_type_version\",source_id=~\"$source_id\",status=~\"$status\"}[1m])",
              "format": "time_series",
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Messages Rate ($status)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        }
      ],
      "schemaVersion": 18,
      "style": "dark",
      "tags": [
        "eventing",
        "kyma"
      ],
      "templating": {
        "list": [
          {
            "allValue": null,
            "current": {
              "selected": true,
              "text": "kyma-system",
              "value": "kyma-system"
            },
            "datasource": "Prometheus",
            "definition": "label_values(total_published_messages, namespace)",
            "hide": 0,
            "includeAll": true,
            "label": "Namespace",
            "multi": false,
            "name": "namespace",
            "options": [],
            "query": "label_values(total_published_messages, namespace)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          },
          {
            "allValue": "",
            "current": {
              "tags": [],
              "text": "ignored",
              "value": [
                "ignored"
              ]
            },
            "datasource": "Prometheus",
            "definition": "label_values(total_published_messages, status)",
            "hide": 0,
            "includeAll": true,
            "label": "Status",
            "multi": true,
            "name": "status",
            "options": [],
            "query": "label_values(total_published_messages, status)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": true
          },
          {
            "allValue": null,
            "current": {
              "text": "All",
              "value": "$__all"
            },
            "datasource": "Prometheus",
            "definition": "label_values(total_published_messages, source_id)",
            "hide": 0,
            "includeAll": true,
            "label": "Source ID",
            "multi": true,
            "name": "source_id",
            "options": [],
            "query": "label_values(total_published_messages, source_id)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          },
          {
            "allValue": null,
            "current": {
              "text": "hello",
              "value": "hello"
            },
            "datasource": "Prometheus",
            "definition": "label_values(total_published_messages, event_type)",
            "hide": 0,
            "includeAll": true,
            "label": "Event Type",
            "multi": true,
            "name": "event_type",
            "options": [],
            "query": "label_values(total_published_messages, event_type)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          },
          {
            "allValue": null,
            "current": {
              "text": "v1",
              "value": "v1"
            },
            "datasource": "Prometheus",
            "definition": "label_values(total_published_messages, event_type_version)",
            "hide": 0,
            "includeAll": true,
            "label": "Event Type Version",
            "multi": true,
            "name": "event_type_version",
            "options": [],
            "query": "label_values(total_published_messages, event_type_version)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          }
        ]
      },
      "time": {
        "from": "now-5m",
        "to": "now"
      },
      "timepicker": {
        "refresh_intervals": [
          "5s",
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "2h",
          "1d"
        ],
        "time_options": [
          "5m",
          "15m",
          "1h",
          "6h",
          "12h",
          "24h",
          "2d",
          "7d",
          "30d"
        ]
      },
      "timezone": "",
      "title": "Kyma / Event Bus",
      "uid": "6iBqM-zZz",
      "version": 1
    }
