Commit 616ec63b authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

dashboard provisioning

parent 45504c88
Loading
Loading
Loading
Loading
+687 −1
Original line number Diff line number Diff line
{}
 No newline at end of file
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "$Scenario",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "query": "SELECT event from events WHERE $timeFilter ORDER BY time ASC",
        "showIn": 0,
        "tagsColumn": "type",
        "textColumn": "",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 3,
  "iteration": 1578522574917,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$Scenario",
      "description": "Shows latency & Throughput between UE1 & Fog1",
      "fill": 2,
      "fillGradient": 4,
      "gridPos": {
        "h": 13,
        "w": 14,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "interval": "",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pluginVersion": "6.4.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "Latency",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "network",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT mean(\"lat\") FROM \"network\" WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter GROUP BY time($__interval) fill(null)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "lat"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        },
        {
          "alias": "Throughput",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "network",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "tput"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Throughput & Latency",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": "Latency (ms)",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "Throughput (Mbps)",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "$Scenario",
      "gridPos": {
        "h": 7,
        "w": 4,
        "x": 14,
        "y": 0
      },
      "id": 6,
      "interval": "",
      "options": {
        "fieldOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "defaults": {
            "links": [],
            "mappings": [],
            "max": 100,
            "min": 0,
            "thresholds": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 60
              },
              {
                "color": "red",
                "value": 100
              }
            ]
          },
          "override": {},
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.5.2",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "10s"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "limit": "",
          "measurement": "network",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "lat"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "slimit": "",
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latency (ms)",
      "type": "gauge"
    },
    {
      "datasource": "$Scenario",
      "gridPos": {
        "h": 6,
        "w": 4,
        "x": 14,
        "y": 7
      },
      "id": 7,
      "options": {
        "fieldOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "defaults": {
            "links": [],
            "mappings": [],
            "max": 100,
            "min": 0,
            "thresholds": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "override": {},
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.5.2",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "10s"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "limit": "",
          "measurement": "network",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "tput"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Throughput (Mbps)",
      "type": "gauge"
    },
    {
      "cacheTimeout": null,
      "columns": [],
      "datasource": "$Scenario",
      "fontSize": "100%",
      "gridPos": {
        "h": 7,
        "w": 14,
        "x": 0,
        "y": 13
      },
      "id": 4,
      "links": [],
      "options": {},
      "pageSize": null,
      "pluginVersion": "6.4.2",
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "Type",
          "colorMode": null,
          "colors": [
            "#C4162A",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "events.type",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Event",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "mappingType": 1,
          "pattern": "events.event",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT type,event from events WHERE $timeFilter ORDER BY time ASC",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Events",
      "transform": "timeseries_to_columns",
      "type": "table"
    }
  ],
  "refresh": "1s",
  "schemaVersion": 21,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "text": "meep-influxdb",
          "value": "meep-influxdb"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Scenario",
        "options": [],
        "query": "influxdb",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {
          "tags": [],
          "text": "ue1-iperf",
          "value": "ue1-iperf"
        },
        "datasource": "$Scenario",
        "definition": "show tag values from network with key = \"src\"",
        "hide": 0,
        "includeAll": false,
        "label": "Source Node",
        "multi": false,
        "name": "src",
        "options": [
          {
            "selected": false,
            "text": "cloud1-iperf",
            "value": "cloud1-iperf"
          },
          {
            "selected": false,
            "text": "cloud1-svc",
            "value": "cloud1-svc"
          },
          {
            "selected": true,
            "text": "ue1-iperf",
            "value": "ue1-iperf"
          },
          {
            "selected": false,
            "text": "ue2-svc",
            "value": "ue2-svc"
          },
          {
            "selected": false,
            "text": "zone1-edge1-iperf",
            "value": "zone1-edge1-iperf"
          },
          {
            "selected": false,
            "text": "zone1-fog1-iperf",
            "value": "zone1-fog1-iperf"
          },
          {
            "selected": false,
            "text": "zone2-edge1-iperf",
            "value": "zone2-edge1-iperf"
          }
        ],
        "query": "show tag values from network with key = \"src\"",
        "refresh": 0,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "tags": [],
          "text": "zone1-fog1-iperf",
          "value": "zone1-fog1-iperf"
        },
        "datasource": "$Scenario",
        "definition": "show tag values from network with key = \"dest\"",
        "hide": 0,
        "includeAll": false,
        "label": "Destination node",
        "multi": false,
        "name": "dest",
        "options": [
          {
            "selected": false,
            "text": "cloud1-iperf",
            "value": "cloud1-iperf"
          },
          {
            "selected": false,
            "text": "cloud1-svc",
            "value": "cloud1-svc"
          },
          {
            "selected": false,
            "text": "ue1-iperf",
            "value": "ue1-iperf"
          },
          {
            "selected": false,
            "text": "ue2-svc",
            "value": "ue2-svc"
          },
          {
            "selected": false,
            "text": "zone1-edge1-iperf",
            "value": "zone1-edge1-iperf"
          },
          {
            "selected": true,
            "text": "zone1-fog1-iperf",
            "value": "zone1-fog1-iperf"
          },
          {
            "selected": false,
            "text": "zone2-edge1-iperf",
            "value": "zone2-edge1-iperf"
          }
        ],
        "query": "show tag values from network with key = \"dest\"",
        "refresh": 0,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1s",
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Custom AdvantEDGE Dashboard v5",
  "uid": "7QNhw2aZz",
  "version": 1
}
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ initContainers:
    image: "{{ .Values.downloadDashboardsImage.repository }}:{{ .Values.downloadDashboardsImage.tag }}"
    imagePullPolicy: {{ .Values.downloadDashboardsImage.pullPolicy }}
    command: ["/bin/sh"]
    args: [ "-c", "mkdir -p /var/lib/grafana/dashboards/default && /bin/sh /etc/grafana/download_dashboards.sh" ]
    args: [ "-c", "mkdir -p /tmp/grafana/dashboards/default && /bin/sh /etc/grafana/download_dashboards.sh" ]
    env:
{{- range $key, $value := .Values.downloadDashboards.env }}
      - name: "{{ $key }}"
@@ -154,7 +154,7 @@ containers:
{{- range $key, $value := $dashboards }}
{{- if (or (hasKey $value "json") (hasKey $value "file")) }}
      - name: dashboards-{{ $provider }}
        mountPath: "/var/lib/grafana/dashboards/{{ $provider }}/{{ $key }}.json"
        mountPath: "/tmp/grafana/dashboards/{{ $provider }}/{{ $key }}.json"
        subPath: "{{ $key }}.json"
{{- end }}
{{- end }}
@@ -163,7 +163,7 @@ containers:
{{- if .Values.dashboardsConfigMaps }}
{{- range keys .Values.dashboardsConfigMaps }}
      - name: dashboards-{{ . }}
        mountPath: "/var/lib/grafana/dashboards/{{ . }}"
        mountPath: "/tmp/grafana/dashboards/{{ . }}"
{{- end }}
{{- end }}
{{- if .Values.datasources }}
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ data:
    -H "Content-Type: application/json;charset=UTF-8" \
      {{ end }}
    {{- if $value.url -}}{{ $value.url }}{{- else -}} https://grafana.com/api/dashboards/{{ $value.gnetId }}/revisions/{{- if $value.revision -}}{{ $value.revision }}{{- else -}}1{{- end -}}/download{{- end -}}{{ if $value.datasource }}| sed 's|\"datasource\":[^,]*|\"datasource\": \"{{ $value.datasource }}\"|g'{{ end }}{{- if $value.b64content -}} | base64 -d {{- end -}} \
    > /var/lib/grafana/dashboards/{{ $provider }}/{{ $key }}.json
    > /tmp/grafana/dashboards/{{ $provider }}/{{ $key }}.json
      {{- end -}}
    {{- end }}
  {{- end }}
+32 −21
Original line number Diff line number Diff line
@@ -311,15 +311,25 @@ plugins: []
## Configure grafana datasources
## ref: http://docs.grafana.org/administration/provisioning/#datasources
##
datasources: {}
#  datasources.yaml:
#    apiVersion: 1
#    datasources:
datasources:
  datasources.yaml:
    apiVersion: 1
    datasources:
#    - name: Prometheus
#      type: prometheus
#      url: http://prometheus-prometheus-server
#      access: proxy
#      isDefault: true
    - name: meep-influxdb
      type: influxdb
      # access: proxy
      database: demo1
      # user: grafana
      url: http://10.3.16.78:30086
      jsonData:
        timeInterval: "10s"
      # secureJsonData:
      #   password: grafana

## Configure notifiers
## ref: http://docs.grafana.org/administration/provisioning/#alert-notification-channels
@@ -342,20 +352,20 @@ notifiers: {}
## Configure grafana dashboard providers
## ref: http://docs.grafana.org/administration/provisioning/#dashboards
##
## `path` must be /var/lib/grafana/dashboards/<provider_name>
## `path` must be /tmp/grafana/dashboards/<provider_name>
##
dashboardProviders: {}
#  dashboardproviders.yaml:
#    apiVersion: 1
#    providers:
#    - name: 'default'
#      orgId: 1
#      folder: ''
#      type: file
#      disableDeletion: false
#      editable: true
#      options:
#        path: /var/lib/grafana/dashboards/default
dashboardProviders:
  dashboardproviders.yaml:
    apiVersion: 1
    providers:
    - name: 'default'
      orgId: 1
      folder: ''
      type: file
      disableDeletion: false
      editable: true
      options:
        path: /tmp/grafana/dashboards/default

## Configure grafana dashboard to import
## NOTE: To use dashboards you must also enable/configure dashboardProviders
@@ -363,13 +373,13 @@ dashboardProviders: {}
##
## dashboards per provider, use provider name as key.
##
dashboards: {}
  # default:
dashboards:
  default:
    custom-dashboard:
      file: dashboards/custom-dashboard.json
  #   some-dashboard:
  #     json: |
  #       $RAW_JSON
  #   custom-dashboard:
  #     file: dashboards/custom-dashboard.json
  #   prometheus-stats:
  #     gnetId: 2
  #     revision: 2
@@ -402,6 +412,7 @@ grafana.ini:
  security:
    allow_embedding: true
  paths:
    # NOTE: These seem to be overriden by GF_ environment variables set in docker image 6.5.2
    data: /var/lib/grafana/data
    logs: /var/log/grafana
    plugins: /var/lib/grafana/plugins