Grafana dashboard: RARE/freeRouter - Distance Vector IGP interface
Description: Display distance vector IGP interface metrics

`scope:local` to freeRouter node

freeRouter Prometheus configuration: (copy & paste in freeRouter CLI)
* Create hardware and software sensor
```
sensor dvigp4int
path dvigp4int/peer/peer
prefix freertr-dvigp4int
key name dvigp4int/peer
command sho ipv4 pvrp 1 interface
prepend dvigp4_iface_
name 0 proto="pvrp1",ifc=
replace \. _
column 1 name neighbors
.
exit

sensor dvigp4peer
path dvigp4peer/peer/peer
prefix freertr-dvigp4peer
key name dvigp4peer/peer
command sho ipv4 pvrp 1 summary
prepend dvigp4_peers_
name 4 proto="pvrp1",ip=
replace \. _
column 5 name learn
column 6 name advert
.
exit

sensor dvigp6int
path dvigp6int/peer/peer
prefix freertr-dvigp6int
key name dvigp6int/peer
command sho ipv6 pvrp 1 interface
prepend dvigp6_iface_
name 0 proto="pvrp1",ifc=
replace \. _
column 1 name neighbors
.
exit

sensor dvigp6peer
path dvigp6peer/peer/peer
prefix freertr-dvigp6peer
key name dvigp6peer/peer
command sho ipv6 pvrp 1 summary
prepend dvigp6_peers_
name 4 proto="pvrp1",ip=
replace \: _
column 5 name learn
column 6 name advert
.
exit
```
* freeRtr server Prometheus agent configuration

```
server prometheus pr
 sensor dvigp4int
 sensor dvigp4peer
 sensor dvigp6peer
 vrf <PROMETHEUS_VRF>
 exit
```
* Prometheus server configuration (sample config with 2 nodes)
```
global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 30s
alerting:
  alertmanagers:
  - static_configs:
    - targets: []
    scheme: http
    timeout: 10s
scrape_configs:
- job_name: router
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - <prometheus_agent_ip_1>:9001
    labels:
      node_name: <prometheus_agent_1_node_name>
  - targets:
    - <prometheus_agent_ip_2>:9001
    labels:
      node_name: <prometheus_agent_2_node_name>
```


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.2.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Display distance vector IGP interface metrics",
  "editable": true,
  "gnetId": 13155,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1662387099613,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [
            {
              "from": "",
              "id": 0,
              "text": "down",
              "to": "",
              "type": 1,
              "value": "0"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "black",
                "value": null
              },
              {
                "color": "red",
                "value": 0
              },
              {
                "color": "dark-green",
                "value": 0.1
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Field"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 314
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 2,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "maxPerRow": 12,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "7.2.0",
      "repeat": "iface",
      "repeatDirection": "h",
      "targets": [
        {
          "expr": "${igp_type}_iface_neighbors{ifc=\"$iface\",node_name=\"$node_name\",proto=\"$protocol\"}",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "${iface}",
      "transformations": [],
      "type": "stat"
    }
  ],
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "[scope:local]"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values({__name__=~\"^dvigp.*\"},node_name)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "node_name",
        "options": [],
        "query": "label_values({__name__=~\"^dvigp.*\"},node_name)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "dvigp4",
          "value": "dvigp4"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "igp_type",
        "options": [
          {
            "selected": true,
            "text": "dvigp4",
            "value": "dvigp4"
          },
          {
            "selected": false,
            "text": "dvigp6",
            "value": "dvigp6"
          }
        ],
        "query": "dvigp4,dvigp6",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(${igp_type}_iface_neighbors{node_name=\"$node_name\"},proto)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "protocol",
        "options": [],
        "query": "label_values(${igp_type}_iface_neighbors{node_name=\"$node_name\"},proto)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(${igp_type}_iface_neighbors{node_name=\"$node_name\",proto=\"$protocol\"},ifc)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "iface",
        "options": [],
        "query": "label_values(${igp_type}_iface_neighbors{node_name=\"$node_name\",proto=\"$protocol\"},ifc)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "RARE/freeRouter - Distance Vector IGP interface",
  "uid": "AoN8AMcGzsss",
  "version": 4
}