apiVersion: v1
kind: ConfigMap
metadata:
  name: monitoring-kyma-frontends-dashboard
  labels:
    grafana_dashboard: "1"
    app: monitoring-grafana
data:
  kyma-frontends-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,
      "id": 57,
      "iteration": 1600434829873,
      "links": [],
      "panels": [
        {
          "content": "\nAll pods having label `kyma-project.io/component: frontend`\n\n",
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "gridPos": {
            "h": 2,
            "w": 12,
            "x": 0,
            "y": 0
          },
          "id": 16,
          "mode": "markdown",
          "timeFrom": null,
          "timeShift": null,
          "title": "Note",
          "type": "text"
        },
        {
          "collapsed": false,
          "datasource": null,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 2
          },
          "id": 4,
          "panels": [],
          "title": "Pod Metrics",
          "type": "row"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 9,
            "w": 12,
            "x": 0,
            "y": 3
          },
          "hiddenSeries": false,
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum by(container) (container_memory_usage_bytes{namespace=\"$namespace\", pod=\"$pod\", container_name!=\"POD\",container!=\"\"})",
              "interval": "",
              "legendFormat": "Current: {{`{{container_name}}`}}",
              "refId": "A"
            },
            {
              "expr": "sum by(container) (kube_pod_container_resource_requests{namespace=\"$namespace\", resource=\"memory\", pod=\"$pod\"})",
              "interval": "",
              "legendFormat": "Requests: {{`{{container}}`}}",
              "refId": "B"
            },
            {
              "expr": "sum by(container) (kube_pod_container_resource_limits{namespace=\"$namespace\", resource=\"memory\", pod=\"$pod\"})",
              "interval": "",
              "legendFormat": "Limit: {{`{{ container }}`}}",
              "refId": "C"
            },
            {
              "expr": "sum by(container) (container_memory_cache{ namespace=\"$namespace\", pod=~\"$pod\", container!=\"POD\"})",
              "interval": "",
              "legendFormat": "Cache: {{`{{ container }}`}}",
              "refId": "D"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Memory Usage",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "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
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 9,
            "w": 12,
            "x": 12,
            "y": 3
          },
          "hiddenSeries": false,
          "id": 8,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum by (container) (irate(container_cpu_usage_seconds_total{namespace=\"$namespace\", image!=\"\", pod=\"$pod\", container!=\"POD\"}[4m]))",
              "interval": "",
              "legendFormat": "Current: {{`{{ container }}`}}",
              "refId": "A"
            },
            {
              "expr": "sum by(container) (kube_pod_container_resource_requests{namespace=\"$namespace\", resource=\"cpu\", pod=\"$pod\"})",
              "interval": "",
              "legendFormat": "Requested: {{`{{ container }}`}}",
              "refId": "B"
            },
            {
              "expr": "sum by(container) (kube_pod_container_resource_limits{namespace=\"$namespace\", resource=\"cpu\", pod=\"$pod\"})",
              "interval": "",
              "legendFormat": "Limit: {{`{{ container }}`}}",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "CPU Usage",
          "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": "0",
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": "0",
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 12
          },
          "hiddenSeries": false,
          "id": 6,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sort_desc(sum by (pod) (irate(container_network_receive_bytes_total{namespace=\"$namespace\", pod=\"$pod\"}[4m])))",
              "interval": "",
              "legendFormat": "RX: {{`{{ pod }}`}}",
              "refId": "A"
            },
            {
              "expr": "sort_desc(sum by (pod) (irate(container_network_transmit_bytes_total{namespace=\"$namespace\", pod=\"$pod\"}[4m])))",
              "interval": "",
              "legendFormat": "TX: {{`{{ pod }}`}}",
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Network I/O",
          "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
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 12
          },
          "hiddenSeries": false,
          "id": 10,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "max by (container) (kube_pod_container_status_restarts_total{ namespace=\"$namespace\", pod=\"$pod\"})",
              "interval": "",
              "legendFormat": "Restarts: {{`{{ container }}`}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Total Restarts Per Container",
          "tooltip": {
            "shared": false,
            "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": "0",
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": "0",
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "collapsed": false,
          "datasource": null,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 20
          },
          "id": 12,
          "panels": [],
          "title": "Logs",
          "type": "row"
        },
        {
          "datasource": "Loki",
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 24,
            "x": 0,
            "y": 21
          },
          "id": 14,
          "options": {
            "showLabels": false,
            "showTime": true,
            "sortOrder": "Descending",
            "wrapLogMessage": true
          },
          "targets": [
            {
              "expr": "{namespace=\"$namespace\", instance=\"$pod\"}",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Logs",
          "type": "logs"
        }
      ],
      "refresh": "10s",
      "schemaVersion": 25,
      "tags": [
        "kyma"
      ],
      "templating": {
        "list": [
          {
            "allValue": null,
            "current": {
              "selected": false,
              "text": "kyma-system",
              "value": "kyma-system"
            },
            "datasource": "Prometheus",
            "definition": "label_values(kube_pod_labels{label_kyma_project_io_component=\"frontend\"},namespace)",
            "hide": 0,
            "includeAll": false,
            "label": null,
            "multi": false,
            "name": "namespace",
            "options": [],
            "query": "label_values(kube_pod_labels{label_kyma_project_io_component=\"frontend\"},namespace)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          },
          {
            "allValue": null,
            "current": {
              "selected": true,
              "text": "helm-broker-addons-ui-7bf8767656-h2j2l",
              "value": "helm-broker-addons-ui-7bf8767656-h2j2l"
            },
            "datasource": "Prometheus",
            "definition": "label_values(kube_pod_labels{label_kyma_project_io_component=\"frontend\",namespace=\"$namespace\"},pod)",
            "hide": 0,
            "includeAll": false,
            "label": null,
            "multi": false,
            "name": "pod",
            "options": [],
            "query": "label_values(kube_pod_labels{label_kyma_project_io_component=\"frontend\",namespace=\"$namespace\"},pod)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          }
        ]
      },
      "time": {
        "from": "now-1h",
        "to": "now"
      },
      "timepicker": {
        "hidden": false,
        "refresh_intervals": [
          "5s",
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "2h",
          "1d"
        ]
      },
      "timezone": "",
      "title": "Kyma / Components / Frontends",
      "uid": "WK_q8xdMk",
      "version": 10
    }
