apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-dashboard-speedtest-exporter-config
  namespace: monitoring
  labels:
    app: grafana
data:
  speedtest-exporter.json: |
    {
      "__inputs": [
        {
          "name": "DS_PROMETHEUS",
          "label": "Prometheus",
          "description": "",
          "type": "datasource",
          "pluginId": "prometheus",
          "pluginName": "Prometheus"
        }
      ],
      "__requires": [
        {
          "type": "panel",
          "id": "gauge",
          "name": "Gauge",
          "version": ""
        },
        {
          "type": "grafana",
          "id": "grafana",
          "name": "Grafana",
          "version": "6.5.2"
        },
        {
          "type": "panel",
          "id": "graph",
          "name": "Graph",
          "version": ""
        },
        {
          "type": "datasource",
          "id": "prometheus",
          "name": "Prometheus",
          "version": "1.0.0"
        }
      ],
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": "-- Grafana --",
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "type": "dashboard"
          }
        ]
      },
      "editable": false,
      "gnetId": 12004,
      "graphTooltip": 0,
      "id": null,
      "iteration": 1585690286418,
      "links": [],
      "panels": [
        {
          "datasource": "${DS_PROMETHEUS}",
          "gridPos": {
            "h": 8,
            "w": 8,
            "x": 0,
            "y": 0
          },
          "id": 2,
          "options": {
            "fieldOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "defaults": {
                "links": [
                  {
                    "title": "",
                    "url": ""
                  }
                ],
                "mappings": [],
                "max": 100,
                "min": 0,
                "thresholds": [
                  {
                    "color": "red",
                    "value": null
                  },
                  {
                    "color": "yellow",
                    "value": 30
                  },
                  {
                    "color": "green",
                    "value": 50
                  }
                ],
                "title": "",
                "unit": "Mbits"
              },
              "override": {},
              "values": false
            },
            "orientation": "auto",
            "showThresholdLabels": false,
            "showThresholdMarkers": true
          },
          "pluginVersion": "6.5.2",
          "targets": [
            {
              "expr": "sum(speedtest_download{cluster=\"$cluster\"}) by(cluster)",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Download",
          "type": "gauge"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "gridPos": {
            "h": 8,
            "w": 8,
            "x": 8,
            "y": 0
          },
          "id": 5,
          "options": {
            "fieldOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "defaults": {
                "links": [
                  {
                    "title": "",
                    "url": ""
                  }
                ],
                "mappings": [],
                "max": 100,
                "min": 0,
                "thresholds": [
                  {
                    "color": "red",
                    "value": null
                  },
                  {
                    "color": "yellow",
                    "value": 30
                  },
                  {
                    "color": "green",
                    "value": 50
                  }
                ],
                "title": "",
                "unit": "Mbits"
              },
              "override": {},
              "values": false
            },
            "orientation": "auto",
            "showThresholdLabels": false,
            "showThresholdMarkers": true
          },
          "pluginVersion": "6.5.2",
          "targets": [
            {
              "expr": "sum(speedtest_upload{cluster=\"$cluster\"}) by(cluster)",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Upload",
          "type": "gauge"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "gridPos": {
            "h": 8,
            "w": 8,
            "x": 16,
            "y": 0
          },
          "id": 6,
          "options": {
            "fieldOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "defaults": {
                "links": [
                  {
                    "title": "",
                    "url": ""
                  }
                ],
                "mappings": [],
                "max": 300,
                "min": 0,
                "thresholds": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "yellow",
                    "value": 50
                  },
                  {
                    "color": "red",
                    "value": 100
                  }
                ],
                "title": "",
                "unit": "ms"
              },
              "override": {},
              "values": false
            },
            "orientation": "auto",
            "showThresholdLabels": false,
            "showThresholdMarkers": true
          },
          "pluginVersion": "6.5.2",
          "targets": [
            {
              "expr": "sum(speedtest_ping{cluster=\"$cluster\"}) by(cluster)",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Ping",
          "type": "gauge"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 24,
            "x": 0,
            "y": 8
          },
          "hiddenSeries": false,
          "id": 4,
          "interval": "",
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "Ping",
              "yaxis": 2
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum(speedtest_download{cluster=\"$cluster\"}) by(cluster)",
              "instant": false,
              "legendFormat": "Download",
              "refId": "A"
            },
            {
              "expr": "sum(speedtest_upload{cluster=\"$cluster\"}) by(cluster)",
              "instant": false,
              "intervalFactor": 1,
              "legendFormat": "Upload",
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Speedtest",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "Mbits",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "decimals": null,
              "format": "ms",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 24,
            "x": 0,
            "y": 16
          },
          "hiddenSeries": false,
          "id": 7,
          "interval": "",
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "Ping",
              "yaxis": 1
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum(speedtest_ping{cluster=\"$cluster\"}) by(cluster)",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Ping",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Ping time",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ms",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "decimals": null,
              "format": "ms",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        }
      ],
      "schemaVersion": 21,
      "style": "dark",
      "tags": [
        "speedtest",
        "network"
      ],
      "templating": {
        "list": [
          {
            "hide": 0,
            "label": "datasource",
            "name": "DS_PROMETHEUS",
            "options": [],
            "query": "prometheus",
            "refresh": 1,
            "regex": "",
            "type": "datasource"
          },
          {
            "allValue": null,
            "current": {},
            "datasource": "${DS_PROMETHEUS}",
            "definition": "label_values(speedtest_download, cluster)",
            "hide": 0,
            "includeAll": false,
            "label": "Cluster",
            "multi": false,
            "name": "cluster",
            "options": [],
            "query": "label_values(speedtest_download, cluster)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          }
        ]
      },
      "time": {
        "from": "now-2d",
        "to": "now"
      },
      "timepicker": {
        "refresh_intervals": [
          "5s",
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "2h",
          "1d"
        ]
      },
      "timezone": "",
      "title": "Prometheus Speedtest Exporter",
      "uid": "NmLZ141Zk",
      "version": 1,
      "description": "Dashboard for https://github.com/nlamirault/speedtest_exporter"
    }
