---
apiVersion: v1
kind: ConfigMap
metadata:
  name: dashboard-platform-overview
  labels:
    grafana_dashboard: "1"
data:
  platform-detailed-overview.json: |-
    {
        "__inputs": [
            {
            "name": "DS_PROMETHEUS",
            "label": "Prometheus",
            "description": "",
            "type": "datasource",
            "pluginId": "prometheus",
            "pluginName": "Prometheus"
            }
        ],
        "__requires": [
            {
            "type": "grafana",
            "id": "grafana",
            "name": "Grafana",
            "version": "5.1.3"
            },
            {
            "type": "panel",
            "id": "graph",
            "name": "Graph",
            "version": "5.0.0"
            },
            {
            "type": "datasource",
            "id": "prometheus",
            "name": "Prometheus",
            "version": "5.0.0"
            },
            {
            "type": "panel",
            "id": "singlestat",
            "name": "Singlestat",
            "version": "5.0.0"
            }
        ],
        "annotations": {
            "list": [
            {
                "builtIn": 1,
                "datasource": "-- Grafana --",
                "enable": true,
                "hide": true,
                "iconColor": "rgba(0, 211, 255, 1)",
                "name": "Annotations & Alerts",
                "type": "dashboard"
            }
            ]
        },
        "description": "Monitors overall status of the platform",
        "editable": true,
        "gnetId": null,
        "graphTooltip": 0,
        "id": null,
        "iteration": 1562059249317,
        "links": [],
        "panels": [
            {
            "cacheTimeout": null,
            "colorBackground": true,
            "colorValue": false,
            "colors": [
                "#299c46",
                "rgba(237, 129, 40, 0.89)",
                "#d44a3a"
            ],
            "datasource": "${DS_PROMETHEUS}",
            "format": "short",
            "gauge": {
                "maxValue": 100,
                "minValue": 0,
                "show": false,
                "thresholdLabels": false,
                "thresholdMarkers": true
            },
            "gridPos": {
                "h": 7,
                "w": 4,
                "x": 0,
                "y": 0
            },
            "id": 2,
            "interval": null,
            "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"
                }
            ],
            "sparkline": {
                "fillColor": "rgba(31, 118, 189, 0.18)",
                "full": false,
                "lineColor": "rgb(31, 120, 193)",
                "show": false
            },
            "tableColumn": "",
            "targets": [
                {
                "expr": "sum(increase(httpmetrics_requests_total[$fixedinterval]))",
                "format": "time_series",
                "intervalFactor": 1,
                "refId": "A"
                }
            ],
            "thresholds": "1500000,3000000",
            "title": "Total Requests",
            "transparent": false,
            "type": "singlestat",
            "valueFontSize": "200%",
            "valueMaps": [
                {
                "op": "=",
                "text": "N/A",
                "value": "null"
                }
            ],
            "valueName": "current"
            },
            {
            "cacheTimeout": null,
            "colorBackground": true,
            "colorValue": false,
            "colors": [
                "#299c46",
                "rgba(237, 129, 40, 0.89)",
                "#d44a3a"
            ],
            "datasource": "${DS_PROMETHEUS}",
            "format": "percent",
            "gauge": {
                "maxValue": 100,
                "minValue": 0,
                "show": false,
                "thresholdLabels": false,
                "thresholdMarkers": true
            },
            "gridPos": {
                "h": 7,
                "w": 4,
                "x": 4,
                "y": 0
            },
            "id": 3,
            "interval": null,
            "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"
                }
            ],
            "sparkline": {
                "fillColor": "rgba(31, 118, 189, 0.18)",
                "full": false,
                "lineColor": "rgb(31, 120, 193)",
                "show": false
            },
            "tableColumn": "",
            "targets": [
                {
                "expr": "(sum(increase(httpmetrics_requests_total{code!~\"2..|3..\"}[$fixedinterval])) - sum(increase(httpmetrics_requests_total{app=~\"response.*\", code=\"404\", path=\"/api/applications/{id}/acceptance\"}[$fixedinterval]))) * 100 / sum(increase(httpmetrics_requests_total[$fixedinterval]))",
                "format": "time_series",
                "intervalFactor": 1,
                "refId": "A"
                }
            ],
            "thresholds": "0.1,1",
            "title": "Error Rate",
            "transparent": false,
            "type": "singlestat",
            "valueFontSize": "200%",
            "valueMaps": [
                {
                "op": "=",
                "text": "N/A",
                "value": "null"
                }
            ],
            "valueName": "current"
            },
            {
            "aliasColors": {},
            "bars": true,
            "dashLength": 10,
            "dashes": false,
            "datasource": "${DS_PROMETHEUS}",
            "fill": 1,
            "gridPos": {
                "h": 7,
                "w": 16,
                "x": 8,
                "y": 0
            },
            "id": 5,
            "legend": {
                "avg": false,
                "current": false,
                "hideEmpty": false,
                "hideZero": false,
                "max": false,
                "min": false,
                "show": false,
                "total": false,
                "values": false
            },
            "lines": false,
            "linewidth": 1,
            "links": [],
            "nullPointMode": "null",
            "percentage": false,
            "pointradius": 5,
            "points": false,
            "renderer": "flot",
            "seriesOverrides": [],
            "spaceLength": 10,
            "stack": false,
            "steppedLine": false,
            "targets": [
                {
                "expr": "sum(increase(httpmetrics_requests_total{code=\"404\"}[$fixedinterval])) by (code) - sum(increase(httpmetrics_requests_total{app=~\"response.*\", code=\"404\", path=\"/api/applications/{id}/acceptance\"}[$fixedinterval])) by (code)",
                "format": "time_series",
                "instant": true,
                "intervalFactor": 1,
                "legendFormat": "{{code}}",
                "refId": "A"
                },
                {
                "expr": "sum(increase(httpmetrics_requests_total{code!~\"2..|3..|404\"}[$fixedinterval])) by (code) > 0",
                "format": "time_series",
                "instant": true,
                "intervalFactor": 1,
                "legendFormat": "{{code}}",
                "refId": "B"
                }
            ],
            "thresholds": [],
            "timeFrom": null,
            "timeShift": null,
            "title": "Error Distribution",
            "tooltip": {
                "shared": false,
                "sort": 0,
                "value_type": "individual"
            },
            "type": "graph",
            "xaxis": {
                "buckets": null,
                "mode": "series",
                "name": null,
                "show": true,
                "values": [
                "current"
                ]
            },
            "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": "${DS_PROMETHEUS}",
            "fill": 1,
            "gridPos": {
                "h": 7,
                "w": 24,
                "x": 0,
                "y": 7
            },
            "id": 6,
            "legend": {
                "alignAsTable": false,
                "avg": false,
                "current": false,
                "hideEmpty": false,
                "hideZero": false,
                "max": false,
                "min": false,
                "show": true,
                "total": false,
                "values": false
            },
            "lines": true,
            "linewidth": 1,
            "links": [],
            "nullPointMode": "null",
            "percentage": false,
            "pointradius": 5,
            "points": false,
            "renderer": "flot",
            "seriesOverrides": [],
            "spaceLength": 10,
            "stack": false,
            "steppedLine": false,
            "targets": [
                {
                "expr": "(sum(increase(httpmetrics_requests_total{code=\"404\"}[$fixedinterval])) by (app) - sum(increase(httpmetrics_requests_total{app=~\"response.*\", code=\"404\", path=\"/api/applications/{id}/acceptance\"}[$fixedinterval])) by (app)) > 0",
                "format": "time_series",
                "intervalFactor": 1,
                "legendFormat": "{{app}}",
                "refId": "A"
                },
                {
                "expr": "sum(increase(httpmetrics_requests_total{code!~\"2..|3..|404\"}[$fixedinterval])) by (app) > 0",
                "format": "time_series",
                "hide": false,
                "intervalFactor": 1,
                "legendFormat": "{{app}}",
                "refId": "B"
                }
            ],
            "thresholds": [],
            "timeFrom": null,
            "timeShift": null,
            "title": "Amount of errors per microservice",
            "tooltip": {
                "shared": true,
                "sort": 0,
                "value_type": "individual"
            },
            "transparent": false,
            "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": "${DS_PROMETHEUS}",
            "fill": 1,
            "gridPos": {
                "h": 7,
                "w": 24,
                "x": 0,
                "y": 14
            },
            "id": 7,
            "legend": {
                "alignAsTable": false,
                "avg": false,
                "current": false,
                "hideEmpty": false,
                "hideZero": false,
                "max": false,
                "min": false,
                "show": true,
                "total": false,
                "values": false
            },
            "lines": true,
            "linewidth": 1,
            "links": [],
            "nullPointMode": "null",
            "percentage": false,
            "pointradius": 5,
            "points": false,
            "renderer": "flot",
            "seriesOverrides": [],
            "spaceLength": 10,
            "stack": false,
            "steppedLine": false,
            "targets": [
                {
                "expr": "histogram_quantile(0.99, sum(rate(httpmetrics_request_duration_seconds_bucket[10m])) by (app, le))",
                "format": "time_series",
                "intervalFactor": 1,
                "legendFormat": "{{app}}",
                "refId": "A"
                }
            ],
            "thresholds": [],
            "timeFrom": "$fixedinterval",
            "timeShift": null,
            "title": "Top 1% slowest requests",
            "tooltip": {
                "shared": true,
                "sort": 0,
                "value_type": "individual"
            },
            "type": "graph",
            "xaxis": {
                "buckets": null,
                "mode": "time",
                "name": null,
                "show": true,
                "values": []
            },
            "yaxes": [
                {
                "format": "s",
                "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": 16,
        "style": "dark",
        "tags": [],
        "templating": {
            "list": [
            {
                "auto": false,
                "auto_count": 30,
                "auto_min": "10s",
                "current": {
                "text": "24h",
                "value": "24h"
                },
                "hide": 2,
                "label": "interval",
                "name": "fixedinterval",
                "options": [
                {
                    "selected": true,
                    "text": "24h",
                    "value": "24h"
                }
                ],
                "query": "24h",
                "refresh": 2,
                "type": "interval"
            }
            ]
        },
        "time": {
            "from": "now-6h",
            "to": "now"
        },
        "timepicker": {
            "hidden": true,
            "nowDelay": "1m",
            "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": "Lendo SE - 24h Overview",
        "uid": "vVHtOQVZz",
        "version": 17
    }
