{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "Prometheus data source that scrapes the collector",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {"type": "grafana", "id": "grafana", "name": "Grafana", "version": "10.0.0"},
    {"type": "datasource", "id": "prometheus", "name": "Prometheus", "version": "1.0.0"},
    {"type": "panel", "id": "timeseries", "name": "Time series", "version": ""},
    {"type": "panel", "id": "table", "name": "Table", "version": ""}
  ],
  "title": "Prelude Collector — Interface Counters",
  "uid": null,
  "tags": ["prelude", "collector"],
  "schemaVersion": 39,
  "time": {"from": "now-30m", "to": "now"},
  "refresh": "10s",
  "templating": {"list": []},
  "panels": [
    {
      "type": "timeseries",
      "title": "Inbound traffic by interface",
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "fieldConfig": {"defaults": {"unit": "bps", "custom": {"fillOpacity": 10}}, "overrides": []},
      "gridPos": {"h": 9, "w": 12, "x": 0, "y": 0},
      "targets": [
        {"refId": "A", "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "expr": "rate(collector_interface_state_in_octets_total[$__rate_interval]) * 8", "legendFormat": "{{device}} {{key}}"}
      ]
    },
    {
      "type": "timeseries",
      "title": "Outbound traffic by interface",
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "fieldConfig": {"defaults": {"unit": "bps", "custom": {"fillOpacity": 10}}, "overrides": []},
      "gridPos": {"h": 9, "w": 12, "x": 12, "y": 0},
      "targets": [
        {"refId": "A", "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "expr": "rate(collector_interface_state_out_octets_total[$__rate_interval]) * 8", "legendFormat": "{{device}} {{key}}"}
      ]
    },
    {
      "type": "table",
      "title": "Interface status (all vendors)",
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "gridPos": {"h": 9, "w": 12, "x": 0, "y": 9},
      "options": {"showHeader": true},
      "targets": [
        {"refId": "A", "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "expr": "collector_interface_state_info", "format": "table", "instant": true}
      ],
      "transformations": [
        {"id": "organize", "options": {"excludeByName": {"Time": true, "__name__": true, "device_id": true, "instance": true, "job": true, "Value": true}, "renameByName": {"device": "Device", "key": "Interface", "admin_status": "Admin", "oper_status": "Oper"}}}
      ]
    },
    {
      "type": "timeseries",
      "title": "Error rate by interface",
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "fieldConfig": {"defaults": {"unit": "pps"}, "overrides": []},
      "gridPos": {"h": 9, "w": 12, "x": 12, "y": 9},
      "targets": [
        {"refId": "A", "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "expr": "rate(collector_interface_state_in_errors_total[$__rate_interval])", "legendFormat": "in · {{device}} {{key}}"},
        {"refId": "B", "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"}, "expr": "rate(collector_interface_state_out_errors_total[$__rate_interval])", "legendFormat": "out · {{device}} {{key}}"}
      ]
    }
  ]
}
