Grafana dashboard: RARE/freeRouter - bridge MAC bytes
Description: Display bridge byte metrics

`scope:local` to freeRouter node

freeRouter Prometheus configuration: (copy & paste in freeRouter CLI)
* Create hardware and software sensor
```
sensor bridge
path bridge/peer/peer
prefix freertr-bridge
key name bridge/peer
command sho bridge 1 | beg addr
prepend br_mac_
name 0 mac=
addname 1 * ifc=
replace \. _
column 3 name pack_tx
column 3 split + typ="sw" typ="hw"
column 4 name pack_rx
column 4 split + typ="sw" typ="hw"
column 5 name pack_dr
column 5 split + typ="sw" typ="hw"
column 6 name byte_tx
column 6 split + typ="sw" typ="hw"
column 7 name byte_rx
column 7 split + typ="sw" typ="hw"
column 8 name byte_dr
column 8 split + typ="sw" typ="hw"
.
exit
```
* freeRtr server Prometheus agent configuration

```
server prometheus pr
 sensor bridge
 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": "panel",
      "id": "graph",
      "name": "Graph",
      "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"
      }
    ]
  },
  "description": "Display bridge byte metrics",
  "editable": true,
  "gnetId": 13244,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1662385522261,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "maxPerRow": 3,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.2.0",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "repeat": "mac",
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "rate(br_mac_byte_tx{node_name=\"$node_name\",typ=\"$cntr_type\",mac=\"$mac\",ifc=\"$node_name_iface\"}[1m])*8",
          "interval": "",
          "legendFormat": "tx",
          "refId": "A"
        },
        {
          "expr": "rate(br_mac_byte_rx{node_name=\"$node_name\",typ=\"$cntr_type\",mac=\"$mac\",ifc=\"$node_name_iface\"}[1m])*8",
          "interval": "",
          "legendFormat": "rx",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "${cntr_type}:${node_name_iface}:${mac}",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bps",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "5s",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "[scope:local]"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values({__name__=~\"^br_mac_.*\"},node_name)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "node_name",
        "options": [],
        "query": "label_values({__name__=~\"^br_mac_.*\"},node_name)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "hw",
          "value": "hw"
        },
        "hide": 0,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "cntr_type",
        "options": [
          {
            "selected": true,
            "text": "hw",
            "value": "hw"
          },
          {
            "selected": false,
            "text": "sw",
            "value": "sw"
          }
        ],
        "query": "hw,sw",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "tx",
          "value": "tx"
        },
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "dir",
        "options": [
          {
            "selected": true,
            "text": "tx",
            "value": "tx"
          },
          {
            "selected": false,
            "text": "rx",
            "value": "rx"
          }
        ],
        "query": "tx,rx",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(br_mac_byte_${dir}{node_name=\"$node_name\"},ifc)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "node_name_iface",
        "options": [],
        "query": "label_values(br_mac_byte_${dir}{node_name=\"$node_name\"},ifc)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(br_mac_byte_${dir}{node_name=\"$node_name\",ifc=\"$node_name_iface\"},mac)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "mac",
        "options": [],
        "query": "label_values(br_mac_byte_${dir}{node_name=\"$node_name\",ifc=\"$node_name_iface\"},mac)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "RARE/freeRouter - bridge MAC bytes",
  "uid": "sqqgkzcGzbrmac",
  "version": 3
}