{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Traffic golden signal dashboard for RetroDash homelab monitoring",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "#33FF00"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#33FF00",
                "value": null
              },
              {
                "color": "#FFCC00",
                "value": 1000
              },
              {
                "color": "#FF4444",
                "value": 5000
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 6,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "values": false,
          "fields": "",
          "calcs": [
            "lastNotNull"
          ]
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "sum(rate(http_requests_total[$rate_interval]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Requests/sec",
          "refId": "A"
        }
      ],
      "title": "Total Requests/sec",
      "transparent": true,
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "#33FF00"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#33FF00",
                "value": null
              },
              {
                "color": "#FFCC00",
                "value": 10000
              },
              {
                "color": "#FF4444",
                "value": 50000
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 6,
        "x": 6,
        "y": 0
      },
      "id": 2,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "values": false,
          "fields": "",
          "calcs": [
            "lastNotNull"
          ]
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "node_netstat_Tcp_CurrEstab",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Active Connections",
          "refId": "A"
        }
      ],
      "title": "Active Connections",
      "transparent": true,
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "#00A3FF"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#00A3FF",
                "value": null
              },
              {
                "color": "#FFCC00",
                "value": 10485760
              },
              {
                "color": "#FF4444",
                "value": 104857600
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 6,
        "x": 12,
        "y": 0
      },
      "id": 3,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "values": false,
          "fields": "",
          "calcs": [
            "lastNotNull"
          ]
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "sum(rate(node_network_receive_bytes_total{device!~\"lo|docker.*|veth.*\"}[$rate_interval]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Network In",
          "refId": "A"
        }
      ],
      "title": "Network In",
      "transparent": true,
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "#33FF00"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#33FF00",
                "value": null
              },
              {
                "color": "#FFCC00",
                "value": 10485760
              },
              {
                "color": "#FF4444",
                "value": 104857600
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "id": 4,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "values": false,
          "fields": "",
          "calcs": [
            "lastNotNull"
          ]
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "sum(rate(node_network_transmit_bytes_total{device!~\"lo|docker.*|veth.*\"}[$rate_interval]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Network Out",
          "refId": "A"
        }
      ],
      "title": "Network Out",
      "transparent": true,
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "Requests/sec",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 15,
            "gradientMode": "opacity",
            "hideFrom": {
              "tooltip": false,
              "viz": false,
              "legend": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "max": null,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "200"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#33FF00",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "201"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#00A3FF",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "400"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#FFCC00",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "404"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#FFCC00",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "500"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#FF4444",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 0,
        "y": 5
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "sum(rate(http_requests_total[$rate_interval])) by (status_code)",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{ status_code }}",
          "refId": "A"
        }
      ],
      "title": "Request Rate Over Time",
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "Bytes/sec",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 15,
            "gradientMode": "opacity",
            "hideFrom": {
              "tooltip": false,
              "viz": false,
              "legend": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "max": null,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Receive"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#33FF00",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Transmit"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#00A3FF",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 12,
        "y": 5
      },
      "id": 6,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "sum(rate(node_network_receive_bytes_total{device!~\"lo|docker.*|veth.*\"}[$rate_interval]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Receive",
          "refId": "A"
        },
        {
          "expr": "sum(rate(node_network_transmit_bytes_total{device!~\"lo|docker.*|veth.*\"}[$rate_interval]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Transmit",
          "refId": "B"
        }
      ],
      "title": "Network Throughput",
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "Bytes/sec",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 20,
            "gradientMode": "none",
            "hideFrom": {
              "tooltip": false,
              "viz": false,
              "legend": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "max": null,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#33FF00",
                "value": null
              },
              {
                "color": "#FFCC00",
                "value": 10485760
              },
              {
                "color": "#FF4444",
                "value": 104857600
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 15
      },
      "id": 7,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "topk(10, sum(rate(node_network_receive_bytes_total{device!~\"lo|docker.*|veth.*\"}[$rate_interval])) by (device) + sum(rate(node_network_transmit_bytes_total{device!~\"lo|docker.*|veth.*\"}[$rate_interval])) by (device))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{ device }}",
          "refId": "A"
        }
      ],
      "title": "Traffic by Node",
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#33FF00",
                "value": null
              },
              {
                "color": "#FFCC00",
                "value": 5242880
              },
              {
                "color": "#FF4444",
                "value": 52428800
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Pod"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.width",
                "value": 200
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Namespace"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.width",
                "value": 120
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 15
      },
      "id": 8,
      "options": {
        "footer": {
          "countRows": "footer",
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "displayName": "Bandwidth",
            "desc": true
          }
        ]
      },
      "pluginVersion": "10.0.0",
      "targets": [
        {
          "expr": "topk(5, sum(rate(container_network_receive_bytes_total[$rate_interval]) + rate(container_network_transmit_bytes_total[$rate_interval])) by (pod_name, namespace))",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": false,
              "__name__": true,
              "job": true,
              "instance": true
            },
            "indexByName": {},
            "renameByName": {
              "pod_name": "Pod",
              "namespace": "Namespace",
              "Value": "Bandwidth"
            }
          }
        }
      ],
      "title": "Top Talkers (Pods)",
      "transparent": true,
      "type": "table"
    }
  ],
  "refresh": "10s",
  "schemaVersion": 39,
  "style": "dark",
  "tags": [
    "retrodash",
    "golden-signals",
    "traffic"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "Prometheus",
          "value": "prometheus"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Datasource",
        "multi": false,
        "name": "DS_PROMETHEUS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "datasource"
      },
      {
        "name": "job_node",
        "type": "custom",
        "label": "Node Exporter Job",
        "current": {
          "text": "node-exporter",
          "value": "node-exporter"
        },
        "options": [
          {
            "text": "node-exporter",
            "value": "node-exporter",
            "selected": true
          },
          {
            "text": "node",
            "value": "node",
            "selected": false
          }
        ],
        "query": "node-exporter,node"
      },
      {
        "name": "rate_interval",
        "type": "custom",
        "label": "Rate Window",
        "current": {
          "text": "5m",
          "value": "5m"
        },
        "options": [
          {
            "text": "1m",
            "value": "1m",
            "selected": false
          },
          {
            "text": "5m",
            "value": "5m",
            "selected": true
          },
          {
            "text": "15m",
            "value": "15m",
            "selected": false
          },
          {
            "text": "30m",
            "value": "30m",
            "selected": false
          }
        ],
        "query": "1m,5m,15m,30m"
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "hidden": false,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "browser",
  "title": "RetroDash // TRAFFIC",
  "uid": "retrodash-traffic",
  "version": 1,
  "weekStart": "",
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "Prometheus datasource",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ]
}
