{
  "uid": "fleet-overview",
  "title": "Fleet Overview",
  "tags": ["network", "osnm", "ch10"],
  "schemaVersion": 39,
  "refresh": "30s",
  "time": { "from": "now-3h", "to": "now" },
  "templating": { "list": [] },
  "panels": [
    {
      "id": 1,
      "title": "Scrape Targets Up",
      "type": "stat",
      "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" },
      "gridPos": { "h": 5, "w": 6, "x": 0, "y": 0 },
      "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 2 } ] } } },
      "targets": [ { "refId": "A", "expr": "count(up == 1)", "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" } } ]
    },
    {
      "id": 2,
      "title": "Devices Reporting",
      "type": "stat",
      "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" },
      "gridPos": { "h": 5, "w": 6, "x": 6, "y": 0 },
      "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 9 } ] } } },
      "targets": [ { "refId": "A", "expr": "count(count by (source) (interfaces_in_octets))", "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" } } ]
    },
    {
      "id": 3,
      "title": "Total Uplink In (bits/s)",
      "type": "stat",
      "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" },
      "gridPos": { "h": 5, "w": 12, "x": 12, "y": 0 },
      "fieldConfig": { "defaults": { "unit": "bps" } },
      "targets": [ { "refId": "A", "expr": "sum(rate(interfaces_in_octets{intf_role=\"uplink\"}[5m]) * 8)", "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" } } ]
    },
    {
      "id": 4,
      "title": "Inbound per Device (bits/s)",
      "type": "timeseries",
      "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" },
      "gridPos": { "h": 9, "w": 24, "x": 0, "y": 5 },
      "fieldConfig": { "defaults": { "unit": "bps", "custom": { "drawStyle": "line", "fillOpacity": 10 } } },
      "options": { "legend": { "displayMode": "table", "placement": "right", "calcs": ["lastNotNull", "max"] } },
      "targets": [ { "refId": "A", "expr": "sum by (source) (rate(interfaces_in_octets[5m]) * 8)", "legendFormat": "{{source}}", "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" } } ]
    },
    {
      "id": 5,
      "title": "Per-Device Traffic — click a row to drill in",
      "type": "table",
      "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" },
      "gridPos": { "h": 10, "w": 24, "x": 0, "y": 14 },
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "links": [
            {
              "title": "Drill into ${__data.fields.source}",
              "url": "/d/device-drilldown/device-drill-down?var-device=${__data.fields.source}&${__url_time_range}"
            }
          ]
        },
        "overrides": []
      },
      "options": { "showHeader": true },
      "transformations": [
        { "id": "labelsToFields", "options": { "mode": "columns" } },
        { "id": "organize", "options": { "excludeByName": { "Time": true, "job": true, "instance": true, "intf_role": true, "path": true, "name": false } } }
      ],
      "targets": [ { "refId": "A", "expr": "sum by (source) (rate(interfaces_in_octets[5m]) * 8)", "format": "table", "instant": true, "legendFormat": "{{source}}", "datasource": { "type": "prometheus", "uid": "P4169E866C3094E38" } } ]
    }
  ]
}
