---
apiVersion: v1
kind: ConfigMap
metadata:
  name: dashboard-http-traffic
  labels:
    grafana_dashboard: "1"
data:
  http-traffic.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": 1539859706184,
        "links": [],
        "panels": [
            {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": null,
                "fill": 1,
                "gridPos": {
                    "h": 9,
                    "w": 24,
                    "x": 0,
                    "y": 0
                },
                "id": 2,
                "legend": {
                    "avg": false,
                    "current": false,
                    "max": false,
                    "min": false,
                    "show": false,
                    "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(rate(http_requests_total{app=\"[[app]]\"}[5m]))",
                        "format": "time_series",
                        "intervalFactor": 1,
                        "legendFormat": "",
                        "refId": "A"
                    }
                ],
                "thresholds": [],
                "timeFrom": null,
                "timeShift": null,
                "title": "Request rate (req/s)",
                "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,
                "fill": 1,
                "gridPos": {
                    "h": 9,
                    "w": 24,
                    "x": 0,
                    "y": 9
                },
                "id": 4,
                "legend": {
                    "avg": false,
                    "current": false,
                    "max": false,
                    "min": false,
                    "show": false,
                    "total": false,
                    "values": false
                },
                "lines": true,
                "linewidth": 1,
                "links": [],
                "nullPointMode": "null as zero",
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": false,
                "targets": [
                    {
                        "expr": "sum(rate(http_request_duration_seconds_sum{app=\"[[app]]\"}[5m])) / sum(rate(http_request_duration_seconds_count{app=\"[[app]]\"}[5m]))",
                        "format": "time_series",
                        "intervalFactor": 1,
                        "legendFormat": "",
                        "refId": "A"
                    }
                ],
                "thresholds": [],
                "timeFrom": null,
                "timeShift": null,
                "title": "Request latency",
                "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": [
                {
                    "allValue": null,
                    "current": {
                        "tags": [],
                        "text": "private-loan-application-service",
                        "value": "private-loan-application-service"
                    },
                    "datasource": "Prometheus",
                    "hide": 0,
                    "includeAll": false,
                    "label": null,
                    "multi": false,
                    "name": "app",
                    "options": [],
                    "query": "label_values(app)",
                    "refresh": 1,
                    "regex": "",
                    "skipUrlSync": false,
                    "sort": 0,
                    "tagValuesQuery": "",
                    "tags": [],
                    "tagsQuery": "",
                    "type": "query",
                    "useTags": false
                }
            ]
        },
        "time": {
            "from": "now-6h",
            "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": "HTTP traffic",
        "uid": "EPRpmVbmk",
        "version": 4
    }
