Untitled

mail@pastecode.io avatar
unknown
json
2 years ago
16 kB
26
Indexable
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": 36,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Uchgd2-Vz"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 5,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.3.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "wireguard_peers_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\"}",
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "A"
        }
      ],
      "title": "Peers total",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Uchgd2-Vz"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 5,
        "x": 5,
        "y": 0
      },
      "id": 4,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.3.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "expr": "wireguard_bytes_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\", direction=\"rx\"}",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Total bytes RX",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Uchgd2-Vz"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 5,
        "x": 10,
        "y": 0
      },
      "id": 5,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.3.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "expr": "wireguard_bytes_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\", direction=\"tx\"}",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Total bytes TX",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Uchgd2-Vz"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 30,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "binBps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 9,
        "x": 15,
        "y": 0
      },
      "id": 7,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "expr": "sum(irate(wireguard_bytes_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\"}[5m])) by (direction)",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "RX/TX rate",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Uchgd2-Vz"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "TX"
            },
            "properties": [
              {
                "id": "unit",
                "value": "decbytes"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "RX"
            },
            "properties": [
              {
                "id": "unit",
                "value": "decbytes"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Traffic total"
            },
            "properties": [
              {
                "id": "unit",
                "value": "decbytes"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Last HS"
            },
            "properties": [
              {
                "id": "unit",
                "value": "dtdurations"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 9,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.3.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(wireguard_peer_bytes_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\"}) by (hostname, peer, interface) * on(hostname, peer, interface) group_left(name) wireguard_meta ",
          "format": "table",
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "expr": "max(wireguard_peer_bytes_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\", direction=\"rx\"}) by (hostname, peer)",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "expr": "max(wireguard_peer_bytes_total{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\", direction=\"tx\"}) by (hostname, peer)",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "Uchgd2-Vz"
          },
          "editorMode": "code",
          "expr": "wireguard_duration_since_latest_handshake{dc=~\"$dc\", hostname=~\"$hostname\", interface=~\"$interface\"} / 1000",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "D"
        }
      ],
      "title": "Peers information",
      "transformations": [
        {
          "id": "joinByField",
          "options": {
            "byField": "peer",
            "mode": "outer"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "Time 1": true,
              "Time 2": true,
              "Time 3": true,
              "Time 4": true,
              "Value": false,
              "__name__": true,
              "dc": true,
              "hostname": true,
              "hostname 1": true,
              "hostname 3": true,
              "hostname 4": true,
              "instance": true,
              "interface": true,
              "ip": true,
              "job": true,
              "peer": true
            },
            "indexByName": {
              "Time 1": 6,
              "Time 2": 8,
              "Time 3": 10,
              "Time 4": 12,
              "Value #A": 3,
              "Value #B": 1,
              "Value #C": 2,
              "Value #D": 4,
              "dc": 13,
              "hostname 1": 7,
              "hostname 2": 9,
              "hostname 3": 11,
              "hostname 4": 14,
              "instance": 15,
              "interface": 16,
              "ip": 17,
              "job": 18,
              "name": 0,
              "peer": 5
            },
            "renameByName": {
              "Value #A": "Traffic total",
              "Value #B": "TX",
              "Value #C": "RX",
              "Value #D": "Last HS",
              "name": "Peer"
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "schemaVersion": 37,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "d13",
          "value": "d13"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "Uchgd2-Vz"
        },
        "definition": "label_values(up{job=\"wireguard_exporter\"}, dc)",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "dc",
        "options": [],
        "query": {
          "query": "label_values(up{job=\"wireguard_exporter\"}, dc)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "router-1.node.d13.consul",
          "value": "router-1.node.d13.consul"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "Uchgd2-Vz"
        },
        "definition": "label_values(up{job=\"wireguard_exporter\", dc=~\"$dc\"}, hostname)",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "hostname",
        "options": [],
        "query": {
          "query": "label_values(up{job=\"wireguard_exporter\", dc=~\"$dc\"}, hostname)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "wg-private",
          "value": "wg-private"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "Uchgd2-Vz"
        },
        "definition": "label_values(wireguard_peers_total{dc=~\"$dc\", hostname=~\"$hostname\"}, interface)",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "interface",
        "options": [],
        "query": {
          "query": "label_values(wireguard_peers_total{dc=~\"$dc\", hostname=~\"$hostname\"}, interface)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Wireguard",
  "uid": "VvkwMHPVz",
  "version": 12,
  "weekStart": ""
}