{
  "id": null,
  "title": "🏠 Infrastructure Overview - Working",
  "tags": ["infrastructure", "overview", "working"],
  "style": "dark",
  "timezone": "browser",
  "panels": [
    {
      "id": 1,
      "title": "🟢 Service Health Status",
      "type": "stat",
      "targets": [
        {
          "expr": "up",
          "legendFormat": "{{job}} - {{instance}}"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "steps": [
              {"color": "red", "value": 0},
              {"color": "green", "value": 1}
            ]
          },
          "mappings": [
            {
              "options": {
                "0": {"text": "🔴 DOWN", "color": "red"},
                "1": {"text": "🟢 UP", "color": "green"}
              },
              "type": "value"
            }
          ],
          "unit": "short"
        }
      },
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0},
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      }
    },
    {
      "id": 2,
      "title": "📊 System Resource Usage",
      "type": "stat",
      "targets": [
        {
          "expr": "100 - (avg by (instance) (irate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)",
          "legendFormat": "CPU Usage - {{instance}}"
        },
        {
          "expr": "(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100",
          "legendFormat": "Memory Usage - {{instance}}"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "steps": [
              {"color": "green", "value": 0},
              {"color": "yellow", "value": 70},
              {"color": "red", "value": 90}
            ]
          },
          "unit": "percent",
          "min": 0,
          "max": 100
        }
      },
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}
    },
    {
      "id": 3,
      "title": "🌐 Network Traffic",
      "type": "graph",
      "targets": [
        {
          "expr": "rate(node_network_receive_bytes_total[5m]) / 1024 / 1024",
          "legendFormat": "📥 Receive - {{device}}"
        },
        {
          "expr": "rate(node_network_transmit_bytes_total[5m]) / 1024 / 1024",
          "legendFormat": "📤 Transmit - {{device}}"
        }
      ],
      "yAxes": [
        {
          "label": "MB/s",
          "min": 0
        }
      ],
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8}
    },
    {
      "id": 4,
      "title": "💾 Disk Usage",
      "type": "graph",
      "targets": [
        {
          "expr": "(1 - (node_filesystem_avail_bytes / node_filesystem_size_bytes)) * 100",
          "legendFormat": "{{device}} - {{mountpoint}}"
        }
      ],
      "yAxes": [
        {
          "label": "Usage %",
          "min": 0,
          "max": 100
        }
      ],
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 8}
    },
    {
      "id": 5,
      "title": "🔧 Service Response Times",
      "type": "graph",
      "targets": [
        {
          "expr": "probe_duration_seconds{job=\"http-service-health\"}",
          "legendFormat": "{{instance}}"
        }
      ],
      "yAxes": [
        {
          "label": "Response Time (seconds)",
          "min": 0
        }
      ],
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}
    },
    {
      "id": 6,
      "title": "📈 System Load Average",
      "type": "graph",
      "targets": [
        {
          "expr": "node_load1",
          "legendFormat": "1m Load - {{instance}}"
        },
        {
          "expr": "node_load5",
          "legendFormat": "5m Load - {{instance}}"
        },
        {
          "expr": "node_load15",
          "legendFormat": "15m Load - {{instance}}"
        }
      ],
      "yAxes": [
        {
          "label": "Load Average"
        }
      ],
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}
    },
    {
      "id": 7,
      "title": "🌐 HTTP Status Codes",
      "type": "graph",
      "targets": [
        {
          "expr": "probe_http_status_code{job=\"http-service-health\"}",
          "legendFormat": "{{instance}} - {{code}}"
        }
      ],
      "yAxes": [
        {
          "label": "HTTP Status Code",
          "min": 0,
          "max": 600
        }
      ],
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 24}
    },
    {
      "id": 8,
      "title": "📊 Active Services Summary",
      "type": "table",
      "targets": [
        {
          "expr": "up",
          "format": "table",
          "instant": true
        }
      ],
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "__name__": true
            },
            "renameByName": {
              "job": "Service Type",
              "instance": "Service Endpoint",
              "Value": "Status"
            }
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "options": {
                "0": {"text": "🔴 DOWN", "color": "red"},
                "1": {"text": "🟢 UP", "color": "green"}
              },
              "type": "value"
            }
          ]
        }
      },
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 24}
    }
  ],
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "refresh": "30s"
}
