{
  "annotations": { "list": [] },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "title": "Total Monthly Savings",
      "type": "stat",
      "gridPos": { "h": 6, "w": 6, "x": 0, "y": 0 },
      "targets": [
        {
          "expr": "sum(cloudwise_waste_monthly_savings)",
          "legendFormat": "Total Savings"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "currencyUSD",
          "thresholds": {
            "steps": [
              { "color": "green", "value": null },
              { "color": "yellow", "value": 100 },
              { "color": "red", "value": 500 }
            ]
          }
        }
      }
    },
    {
      "title": "Total Waste Items",
      "type": "stat",
      "gridPos": { "h": 6, "w": 6, "x": 6, "y": 0 },
      "targets": [
        {
          "expr": "sum(cloudwise_waste_items_total)",
          "legendFormat": "Total Items"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "steps": [
              { "color": "green", "value": null },
              { "color": "yellow", "value": 10 },
              { "color": "red", "value": 50 }
            ]
          }
        }
      }
    },
    {
      "title": "Connected Accounts",
      "type": "stat",
      "gridPos": { "h": 6, "w": 6, "x": 12, "y": 0 },
      "targets": [
        {
          "expr": "cloudwise_accounts_total",
          "legendFormat": "Accounts"
        }
      ]
    },
    {
      "title": "Last Scan",
      "type": "stat",
      "gridPos": { "h": 6, "w": 6, "x": 18, "y": 0 },
      "targets": [
        {
          "expr": "cloudwise_last_scan_timestamp_seconds",
          "legendFormat": "Last Scan"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "dateTimeFromNow"
        }
      }
    },
    {
      "title": "Monthly Savings by Waste Type",
      "type": "piechart",
      "gridPos": { "h": 10, "w": 12, "x": 0, "y": 6 },
      "targets": [
        {
          "expr": "sum by (waste_type) (cloudwise_waste_monthly_savings)",
          "legendFormat": "{{waste_type}}"
        }
      ],
      "fieldConfig": {
        "defaults": { "unit": "currencyUSD" }
      }
    },
    {
      "title": "Waste Items by Resource Type",
      "type": "piechart",
      "gridPos": { "h": 10, "w": 12, "x": 12, "y": 6 },
      "targets": [
        {
          "expr": "sum by (resource_type) (cloudwise_waste_items_total)",
          "legendFormat": "{{resource_type}}"
        }
      ]
    },
    {
      "title": "Monthly Savings by Region",
      "type": "barchart",
      "gridPos": { "h": 10, "w": 24, "x": 0, "y": 16 },
      "targets": [
        {
          "expr": "sum by (region) (cloudwise_waste_monthly_savings)",
          "legendFormat": "{{region}}"
        }
      ],
      "fieldConfig": {
        "defaults": { "unit": "currencyUSD" }
      }
    },
    {
      "title": "Savings Over Time (by waste type)",
      "type": "timeseries",
      "gridPos": { "h": 10, "w": 24, "x": 0, "y": 26 },
      "targets": [
        {
          "expr": "sum by (waste_type) (cloudwise_waste_monthly_savings)",
          "legendFormat": "{{waste_type}}"
        }
      ],
      "fieldConfig": {
        "defaults": { "unit": "currencyUSD" }
      }
    },
    {
      "title": "High-Confidence Waste Items",
      "type": "stat",
      "gridPos": { "h": 6, "w": 8, "x": 0, "y": 36 },
      "targets": [
        {
          "expr": "sum(cloudwise_waste_items_total{confidence=\"high\"})",
          "legendFormat": "High Confidence"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "fixed", "fixedColor": "red" }
        }
      }
    },
    {
      "title": "Medium-Confidence Waste Items",
      "type": "stat",
      "gridPos": { "h": 6, "w": 8, "x": 8, "y": 36 },
      "targets": [
        {
          "expr": "sum(cloudwise_waste_items_total{confidence=\"medium\"})",
          "legendFormat": "Medium Confidence"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "fixed", "fixedColor": "yellow" }
        }
      }
    },
    {
      "title": "Low-Confidence Waste Items",
      "type": "stat",
      "gridPos": { "h": 6, "w": 8, "x": 16, "y": 36 },
      "targets": [
        {
          "expr": "sum(cloudwise_waste_items_total{confidence=\"low\"})",
          "legendFormat": "Low Confidence"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": { "mode": "fixed", "fixedColor": "green" }
        }
      }
    }
  ],
  "schemaVersion": 39,
  "tags": ["cloudwise", "cost-optimization", "aws"],
  "templating": { "list": [] },
  "time": { "from": "now-7d", "to": "now" },
  "timepicker": {},
  "timezone": "browser",
  "title": "CloudWise Cost Optimization",
  "uid": "cloudwise-waste",
  "version": 1,
  "weekStart": ""
}
