apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-dashboard-definition-knative-health
  namespace: openshift-config-managed
  labels:
    console.openshift.io/dashboard: "true"
data:
  revision-dashboard.json: |+
    {
      "__inputs": [
        {
          "description": "",
          "label": "prometheus",
          "name": "prometheus",
          "pluginId": "prometheus",
          "pluginName": "Prometheus",
          "type": "datasource"
        }
      ],
      "annotations": {
        "list": []
      },
      "editable": false,
      "description" : "Knative Health status",
      "gnetId": null,
      "graphTooltip": 0,
      "links": [],
      "panels": [
         {
           "cacheTimeout": null,
           "colorBackground": false,
           "colorValue": false,
           "colors": [
             "rgba(245, 54, 54, 0.9)",
               "rgba(237, 129, 40, 0.89)",
               "rgba(50, 172, 45, 0.97)"
             ],
           "datasource": "prometheus",
           "editable": false,
           "error": false,
           "format": "none",
           "gauge": {
             "maxValue": 1,
             "minValue": 0,
             "show": false,
             "thresholdLabels": false,
             "thresholdMarkers": true
           },
           "id": 1,
           "interval": null,
           "isNew": true,
           "links": [],
           "mappingType": 1,
           "mappingTypes": [
               {
                 "name": "value to text",
                 "value": 1
               },
               {
                 "name": "range to text",
                 "value": 2
               }
            ],
            "maxDataPoints": 100,
            "nullPointMode": "connected",
            "nullText": null,
            "postfix": "",
            "postfixFontSize": "50%",
            "prefix": "",
            "prefixFontSize": "50%",
            "rangeMaps": [
               {
                 "from": "null",
                 "text": "N/A",
                 "to": "null"
               }
            ],
            "span": 12,
            "sparkline": {
                 "fillColor": "rgba(31, 118, 189, 0.18)",
                 "full": false,
                 "lineColor": "rgb(31, 120, 193)",
                 "show": false
            },
            "targets": [
               {
                 "expr": "min by(job)(knative_up{namespace=\"$namespace\", job=\"knative-openshift-metrics-3\", type=~\"eventing_status|serving_status|kafka_status\"})",
                 "intervalFactor": 2,
                 "legendFormat": "",
                 "metric": "knative_up",
                 "refId": "A",
                 "step": 20
               }
            ],
            "thresholds": "",
            "title": "Knative Status",
            "type": "singlestat",
            "valueFontSize": "200%",
            "valueMaps": [
                 {
                   "op": "=",
                   "text": "N/A",
                   "value": "null"
                 },
                 {
                   "op": "=",
                   "text": "Ready",
                   "value": "1"
                 },
                 {
                   "op": "=",
                   "text": "NotReady",
                   "value": "0"
                 }
            ],
            "valueName": "current"
         },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "prometheus",
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "collapsed": false,
          "gridPos": {
            "h": 9,
            "w": 12,
            "x": 0,
            "y": 0
          },
          "hiddenSeries": false,
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "span": 12,
          "nullPointMode": "null",
          "percentage": false,
          "pluginVersion": "7.1.0",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "knative_up{namespace=\"$namespace\", service=\"knative-openshift-metrics-3\", type=\"serving_status\"}",
              "format": "time_series",
              "interval": "",
              "legendFormat": "Status - 1 is Ready, 0 is NotReady",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Knative Serving Status",
          "tooltip": {
            "shared": true,
            "none": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "none",
              "label": null,
              "decimals": 0,
              "logBase": 1,
              "max": 1,
              "min": 0,
              "show": true
            },
            {
              "format": "none",
              "label": null,
              "decimals": 0,
              "logBase": 1,
              "max": 1,
              "min": 0,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "prometheus",
          "fieldConfig": {
           "defaults": {
           "custom": {}
          },
          "overrides": []
          },
       "fill": 1,
       "fillGradient": 0,
       "gridPos": {
         "h": 9,
         "w": 12,
         "x": 0,
         "y": 0
       },
       "hiddenSeries": false,
       "id": 3,
       "legend": {
         "avg": false,
         "current": false,
         "max": false,
         "min": false,
         "show": true,
         "total": false,
         "values": false
       },
       "lines": true,
       "linewidth": 1,
       "nullPointMode": "null",
       "percentage": false,
       "pluginVersion": "7.1.0",
       "pointradius": 2,
       "points": false,
       "renderer": "flot",
       "span": 12,
       "seriesOverrides": [],
       "spaceLength": 10,
       "stack": false,
       "steppedLine": false,
       "targets": [
         {
           "expr": "knative_up{namespace=\"$namespace\", service=\"knative-openshift-metrics-3\", type=\"eventing_status\"}",
           "format": "time-series",
           "interval": "",
           "legendFormat": "Status - 1 is Ready, 0 is NotReady",
           "refId": "B"
         }
       ],
       "thresholds": [],
       "timeFrom": null,
       "timeRegions": [],
       "timeShift": null,
       "title": "Knative Eventing Status",
       "tooltip": {
         "shared": true,
         "sort": 0,
         "value_type": "individual"
       },
       "type": "graph",
       "xaxis": {
         "buckets": null,
         "mode": "time",
         "name": null,
         "show": true,
         "values": []
       },
       "yaxes": [
         {
           "format": "none",
           "label": null,
           "logBase": 1,
           "max": 1,
           "min": 0,
           "show": false
         },
         {
           "format": "none",
           "label": null,
           "logBase": 1,
           "max": 1,
           "min": 0,
           "show": false
         }
       ],
       "yaxis": {
       "align": false,
       "alignLevel": null
       }
      },
      {
        "aliasColors": {},
        "bars": false,
        "dashLength": 10,
        "dashes": false,
        "datasource": "prometheus",
        "fieldConfig": {
         "defaults": {
         "custom": {}
        },
        "overrides": []
        },
        "fill": 1,
        "fillGradient": 0,
        "hiddenSeries": false,
        "id": 4,
        "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
        },
       "lines": true,
       "linewidth": 1,
       "nullPointMode": "null",
       "percentage": false,
       "pluginVersion": "7.1.0",
       "pointradius": 2,
       "points": false,
       "renderer": "flot",
       "span": 6,
       "seriesOverrides": [],
       "spaceLength": 10,
       "stack": false,
       "steppedLine": false,
       "targets": [
       {
           "expr": "knative_up{namespace=\"$namespace\", service=\"knative-openshift-metrics-3\", type=\"kafka_status\"}",
           "format": "time-series",
           "interval": "",
           "legendFormat": "Status - 1 is Ready, 0 is NotReady",
           "refId": "B"
       }
      ],
       "thresholds": [],
       "timeFrom": null,
       "timeRegions": [],
       "timeShift": null,
       "title": "Knative Kafka Status",
       "tooltip": {
         "shared": true,
         "sort": 0,
         "value_type": "individual"
       },
       "type": "graph",
       "xaxis": {
         "buckets": null,
         "mode": "time",
         "name": null,
         "show": true,
         "values": []
       },
       "yaxes": [
         {
           "format": "none",
           "label": null,
           "logBase": 1,
           "max": 1,
           "min": 0,
           "show": false
         },
         {
           "format": "none",
           "label": null,
           "logBase": 1,
           "max": 1,
           "min": 0,
           "show": false
         }
       ],
       "yaxis": {
       "align": false,
       "alignLevel": null
       }
      }
     ],
     "schemaVersion": 26,
     "style": "dark",
      "tags": [],
      "templating": {
         "list": [
          {
            "allValue": null,
            "current": {},
            "datasource": "prometheus",
            "hide": 0,
            "includeAll": false,
            "label": "Namespace",
            "multi": false,
            "name": "namespace",
            "options": [],
            "query": "label_values(knative_up{namespace!=\"unknown\"}, namespace)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
           }
        ]
      },
      "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": "Knative Health Status",
      "uid": "bhpVnWVMz",
      "version": 1
    }
