{
  "title": "Private Cloud NAS — Overview",
  "uid": "nas-overview",
  "timezone": "browser",
  "schemaVersion": 39,
  "version": 1,
  "editable": true,
  "refresh": "30s",
  "time": { "from": "now-6h", "to": "now" },
  "panels": [
    {
      "id": 1,
      "type": "stat",
      "title": "Application",
      "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_up", "refId": "A" }],
      "fieldConfig": {
        "defaults": {
          "mappings": [
            { "type": "value", "options": { "0": { "text": "DOWN", "color": "red" }, "1": { "text": "UP", "color": "green" } } }
          ],
          "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }
        }
      }
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Database",
      "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_database_up", "refId": "A" }],
      "fieldConfig": {
        "defaults": {
          "mappings": [
            { "type": "value", "options": { "0": { "text": "DOWN", "color": "red" }, "1": { "text": "UP", "color": "green" } } }
          ],
          "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }
        }
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Storage Agent (§50)",
      "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_storage_agent_up", "refId": "A" }],
      "fieldConfig": {
        "defaults": {
          "mappings": [
            { "type": "value", "options": { "0": { "text": "DOWN", "color": "red" }, "1": { "text": "UP", "color": "green" } } }
          ],
          "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }
        }
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "Users",
      "gridPos": { "h": 4, "w": 4, "x": 12, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_users_total", "refId": "A" }]
    },
    {
      "id": 5,
      "type": "stat",
      "title": "Files",
      "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_files_total", "refId": "A" }]
    },
    {
      "id": 6,
      "type": "stat",
      "title": "Failed jobs",
      "gridPos": { "h": 4, "w": 4, "x": 20, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_queue_failed_jobs_total", "refId": "A" }],
      "fieldConfig": {
        "defaults": {
          "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "red", "value": 1 }] }
        }
      }
    },
    {
      "id": 7,
      "type": "timeseries",
      "title": "Queue depth (pending jobs)",
      "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "targets": [{ "expr": "nas_queue_pending_jobs", "refId": "A", "legendFormat": "pending" }]
    },
    {
      "id": 8,
      "type": "timeseries",
      "title": "Total storage used",
      "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 },
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "fieldConfig": { "defaults": { "unit": "bytes" } },
      "targets": [{ "expr": "nas_storage_used_bytes", "refId": "A", "legendFormat": "used" }]
    }
  ]
}
