{
  "__inputs": [
    {
      "name": "DS_LOCALHOST",
      "label": "localhost",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.0.0"
    },
    {
      "type": "panel",
      "id": "heatmap",
      "name": "Heatmap",
      "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": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1600696627318,
  "links": [],
  "panels": [
    {
      "dataFormat": "tsbuckets",
      "datasource": "${DS_LOCALHOST}",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-GrYlRd"
          },
          "decimals": 2,
          "mappings": [],
          "max": 1500,
          "min": 0,
          "thresholds": {
            "mode": "ms",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 18,
        "w": 5,
        "x": 0,
        "y": 0
      },
      "id": 162,
      "options": {
        "displayMode": "gradient",
        "minVizHeight": 10,
        "minVizWidth": 0,
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^:$/",
          "limit": 5000,
          "values": true
        },
        "showUnfilled": false,
        "text": {
          "titleSize": 10
        }
      },
      "pluginVersion": "9.1.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "-_h8Yym4z"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "(quantile_over_time($Ratio,probe_duration_seconds{instance=~\"$instance\", job=~\"$job\"}[$frequency]) + (1-avg_over_time(probe_success{instance=~\"$instance\", job=~\"$job\"}[30s])) * $PacketLoss * -0.05) * 1000",
          "format": "time_series",
          "instant": false,
          "interval": "10s",
          "legendFormat": "{{instance}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "overall rank",
      "transformations": [
        {
          "id": "seriesToRows",
          "options": {}
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Metric": {
                "aggregations": [],
                "operation": "groupby"
              },
              "Time": {
                "aggregations": [
                  "count"
                ],
                "operation": "aggregate"
              },
              "Value": {
                "aggregations": [
                  "sum"
                ],
                "operation": "aggregate"
              }
            }
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": ":",
            "binary": {
              "left": "Value (sum)",
              "operator": "/",
              "reducer": "sum",
              "right": "Time (count)"
            },
            "mode": "binary",
            "reduce": {
              "include": [
                "Value (sum)",
                "Time (count)"
              ],
              "reducer": "sum"
            },
            "replaceFields": false
          }
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "desc": true,
                "field": ":"
              }
            ]
          }
        }
      ],
      "type": "bargauge"
    },
    {
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "dataFormat": "tsbuckets",
      "datasource": "${DS_LOCALHOST}",
      "gridPos": {
        "h": 9,
        "w": 19,
        "x": 5,
        "y": 0
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 7,
      "legend": {
        "show": true
      },
      "options": {
        "cellGap": 0,
        "cellValues": {
          "unit": "s"
        },
        "color": {
          "exponent": 0.5,
          "max": 1.5,
          "min": 0,
          "mode": "scheme",
          "scale": "exponential",
          "scheme": "RdYlGn",
          "steps": 128
        }
      },
      "reverseYBuckets": true,
      "targets": [
        {
          "expr": "quantile_over_time($Ratio,probe_duration_seconds{instance=~\"$instance\", job=~\"$job\"}[$frequency]) + (1-avg_over_time(probe_success{instance=~\"$instance\", job=~\"$job\"}[30s]) > bool 0) * $PacketLoss",
          "legendFormat": "{{instance}}",
          "range": true,
          "refId": "A",
          "interval": "$frequency"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$job RTT",
      "tooltip": {
        "show": true,
        "showHistogram": true
      },
      "transformations": [
        {
          "id": "seriesToRows",
          "options": {}
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "field": "Value"
              }
            ]
          }
        },
        {
          "id": "prepareTimeSeries",
          "options": {
            "format": "many"
          }
        }
      ],
      "type": "heatmap-new",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "dtdurations",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "middle",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "dataFormat": "tsbuckets",
      "datasource": "${DS_LOCALHOST}",
      "gridPos": {
        "h": 9,
        "w": 19,
        "x": 5,
        "y": 9
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 8,
      "legend": {
        "show": true
      },
      "options": {
        "calculate": false,
        "calculation": {},
        "cellGap": 2,
        "cellValues": {
          "unit": "percentunit"
        },
        "color": {
          "exponent": 0.7,
          "max": 1,
          "min": 0,
          "mode": "scheme",
          "scale": "exponential",
          "scheme": "Viridis",
          "steps": 8
        },
        "filterValues": {
          "le": -1
        }
      },
      "reverseYBuckets": true,
      "targets": [
        {
          "expr": "1-avg_over_time(probe_success{instance=~\"$instance\",job=~\"$job\"}[$frequency])",
          "format": "time_series",
          "hide": false,
          "legendFormat": "{{instance}}",
          "interval": "$frequency",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$job packet loss",
      "tooltip": {
        "show": true,
        "showHistogram": true
      },
      "transformations": [
        {
          "id": "seriesToRows",
          "options": {}
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "field": "Value"
              }
            ]
          }
        },
        {
          "id": "prepareTimeSeries",
          "options": {
            "format": "many"
          }
        }
      ],
      "type": "heatmap-new",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "percentunit",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "middle",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_LOCALHOST}",
      "decimals": null,
      "description": "This uses the blackbox exporter, which does not expose packet loss, for example. It could be improved with https://github.com/SuperQ/smokeping_prober because it also keeps track of lost samples (https://github.com/SuperQ/smokeping_prober/issues/24). Unfortunately, that still won't make graphs as nice as smokeping, because each probe only keeps one sample, instead of doing multiple like smokeping does (https://github.com/SuperQ/smokeping_prober/issues/36).",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "RTT",
            "axisPlacement": "auto",
            "axisSoftMax": 0.02,
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 27,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 0,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "links": [],
          "mappings": [],
          "max": 1,
          "min": 0,
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "transparent",
                "value": null
              },
              {
                "color": "dark-red",
                "value": 1
              }
            ]
          },
          "unit": "dtdurations"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "packet loss"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#ff001e",
                  "mode": "fixed",
                  "seriesBy": "min"
                }
              },
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "custom.axisLabel",
                "value": "packet loss"
              },
              {
                "id": "custom.gradientMode",
                "value": "none"
              },
              {
                "id": "custom.fillOpacity",
                "value": 0
              },
              {
                "id": "custom.drawStyle",
                "value": "points"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "avg RTT"
            },
            "properties": [
              {
                "id": "custom.drawStyle",
                "value": "line"
              },
              {
                "id": "custom.fillOpacity",
                "value": 0
              },
              {
                "id": "custom.gradientMode",
                "value": "opacity"
              },
              {
                "id": "custom.lineWidth",
                "value": 1
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "min RTT"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": false,
                  "viz": false
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "max RTT"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": false,
                  "viz": false
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "lastNotNull",
            "max",
            "min"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "asc"
        }
      },
      "repeat": "instance",
      "repeatDirection": "v",
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": "${DS_LOCALHOST}",
          "editorMode": "code",
          "expr": "1-avg_over_time(probe_success{instance=~\"$instance\",job=~\"$job\"}[$frequency]) > 0",
          "format": "time_series",
          "legendFormat": "packet loss",
          "refId": "Packet loss"
        },
        {
          "datasource": "${DS_LOCALHOST}",
          "expr": "quantile_over_time($Ratio, probe_duration_seconds{instance=~\"$instance\",job=~\"$job\"}[$frequency])",
          "hide": false,
          "instant": false,
          "legendFormat": "avg RTT",
          "refId": "Avg RTT"
        },
        {
          "datasource": "${DS_LOCALHOST}",
          "expr": "max_over_time(probe_duration_seconds{instance=~\"$instance\",job=~\"$job\"}[$frequency])",
          "hide": false,
          "instant": false,
          "legendFormat": "max RTT",
          "refId": "Max RTT"
        },
        {
          "datasource": "${DS_LOCALHOST}",
          "expr": "min_over_time(probe_duration_seconds{instance=~\"$instance\",job=~\"$job\"}[$frequency])",
          "hide": false,
          "instant": false,
          "legendFormat": "min RTT",
          "refId": "Min RTT"
        }
      ],
      "title": "$instance ($job)",
      "type": "timeseries"
    }
  ],
  "refresh": false,
  "schemaVersion": 21,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_LOCALHOST}",
        "definition": "label_values(up{job=~'$job'}, instance)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "instance",
        "options": [],
        "query": "label_values(up{job=~'$job'}, instance)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_LOCALHOST}",
        "definition": "label_values(job)",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "job",
        "options": [],
        "query": "label_values(job)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "auto": false,
        "auto_count": 30,
        "auto_min": "10s",
        "current": {},
        "hide": 0,
        "label": null,
        "name": "frequency",
        "options": [
          {
            "selected": false,
            "text": "30s",
            "value": "30s"
          },
          {
            "selected": true,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          }
        ],
        "query": "30s,10m,1h,",
        "queryValue": "",
        "refresh": 1,
        "skipUrlSync": false,
        "type": "interval"
      },
      {
        "current": {
          "selected": true,
          "text": "the median",
          "value": "0.5"
        },
        "hide": 0,
        "includeAll": false,
        "label": "show",
        "multi": false,
        "name": "Ratio",
        "options": [
          {
            "selected": true,
            "text": "the median",
            "value": "0.5"
          },
          {
            "selected": false,
            "text": "95th percentile",
            "value": "0.95"
          }
        ],
        "query": "the median : 0.5, 95th percentile : 0.95,",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "yes",
          "value": "-100"
        },
        "hide": 0,
        "includeAll": false,
        "label": "show packet loss",
        "multi": false,
        "name": "PacketLoss",
        "options": [
          {
            "selected": true,
            "text": "yes",
            "value": "-100"
          },
          {
            "selected": false,
            "text": "no",
            "value": "0"
          }
        ],
        "query": "yes : -100, no : 0,",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Network Status",
  "uid": "",
  "version": 9
}
Report abuse