{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 0,
  "links": [
    {
      "asDropdown": false,
      "icon": "external link",
      "includeVars": false,
      "keepTime": false,
      "tags": [],
      "targetBlank": true,
      "title": "WiKi (CZ)",
      "tooltip": "",
      "type": "link",
      "url": "https://wiki.cvut.it/books/server/page/monitoring-pomoci-grafana-loki-prometheus#bkmrk-dashboard"
    }
  ],
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "PBFA97CFB590B2093"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "footer": {
              "reducers": []
            },
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": 0
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Client endpoint"
            },
            "properties": [
              {
                "id": "noValue",
                "value": "<DISCONNECTED>"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Last handshake"
            },
            "properties": [
              {
                "id": "unit",
                "value": "dateTimeFromNow"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 13,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "pluginVersion": "12.3.2",
      "targets": [
        {
          "editorMode": "code",
          "exemplar": false,
          "expr": "wireguard_peer_allowed_ips_info{job=\"$job\",instance=\"$node\"}",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "wireguard_peer_info{job=\"$job\",instance=\"$node\"}",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "{{label_name}}",
          "range": false,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "wireguard_peer_last_handshake_seconds{job=\"$job\",instance=\"$node\"}*1000",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "C"
        }
      ],
      "title": "Clients info",
      "transformations": [
        {
          "id": "joinByField",
          "options": {
            "byField": "public_key",
            "mode": "outer"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time 1": true,
              "Time 2": true,
              "Time 3": true,
              "Value #A": true,
              "Value #B": true,
              "__name__ 1": true,
              "__name__ 2": true,
              "__name__ 3": true,
              "device 1": true,
              "device 2": true,
              "device 3": true,
              "instance 2": true,
              "instance 3": true,
              "job 1": true,
              "job 2": true,
              "job 3": true
            },
            "includeByName": {},
            "indexByName": {
              "Time 1": 7,
              "Time 2": 12,
              "Time 3": 18,
              "Value #A": 11,
              "Value #B": 17,
              "Value #C": 5,
              "__name__ 1": 8,
              "__name__ 2": 13,
              "__name__ 3": 19,
              "allowed_ips": 4,
              "device 1": 9,
              "device 2": 14,
              "device 3": 20,
              "endpoint": 3,
              "family": 2,
              "instance 1": 0,
              "instance 2": 15,
              "instance 3": 21,
              "job 1": 10,
              "job 2": 16,
              "job 3": 22,
              "name": 1,
              "public_key": 6
            },
            "renameByName": {
              "Value #C": "Last handshake",
              "allowed_ips": "Address",
              "endpoint": "Client endpoint",
              "family": "Address family",
              "instance 1": "Host",
              "name": "Client name",
              "public_key": "Client public key"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "PBFA97CFB590B2093"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "barWidthFactor": 0.6,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "showValues": false,
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "line"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": 0
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byRegexp",
              "options": "OUT:.*"
            },
            "properties": [
              {
                "id": "custom.transform",
                "value": "negative-Y"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 13,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 4,
      "options": {
        "legend": {
          "calcs": [
            "max",
            "mean"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "hideZeros": false,
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "12.3.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "disableTextWrap": false,
          "editorMode": "code",
          "expr": "sum by (public_key,name,endpoint) (irate(wireguard_peer_receive_bytes_total{job=\"$job\", instance=\"$node\"}[5m])) ",
          "format": "time_series",
          "fullMetaSearch": false,
          "hide": false,
          "includeNullMetadata": true,
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "IN: {{name}} ({{endpoint}})",
          "refId": "IN",
          "useBackend": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "disableTextWrap": false,
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum by (public_key,name,endpoint) (irate(wireguard_peer_transmit_bytes_total{job=\"$job\", instance=\"$node\"}[5m]))",
          "format": "time_series",
          "fullMetaSearch": false,
          "hide": false,
          "includeNullMetadata": true,
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "OUT: {{name}} ({{endpoint}})",
          "range": true,
          "refId": "OUT",
          "useBackend": false
        }
      ],
      "title": "Throughput",
      "type": "timeseries"
    }
  ],
  "preload": false,
  "refresh": "10s",
  "schemaVersion": 42,
  "tags": [
    "Wireguard",
    "VPN",
    "linux"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "text": "cvut.it-1.in.cvut.it",
          "value": "cvut.it-1.in.cvut.it"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "PBFA97CFB590B2093"
        },
        "definition": "label_values({job=\"wireguard\"},instance)",
        "includeAll": false,
        "label": "Host",
        "name": "node",
        "options": [],
        "query": {
          "qryType": 1,
          "query": "label_values({job=\"wireguard\"},instance)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "type": "query"
      },
      {
        "current": {
          "text": "wireguard",
          "value": "wireguard"
        },
        "definition": "label_values({job=\"wireguard\"},job)",
        "hide": 2,
        "name": "job",
        "options": [],
        "query": {
          "qryType": 1,
          "query": "label_values({job=\"wireguard\"},job)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "browser",
  "title": "WireGuard",
  "uid": "c0T_8RkZz",
  "version": 7,
  "weekStart": "monday"
}