{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 1,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select count(distinct id) from ${table} where state = 'COMPLETED' and eventType = '${eventType}'",
          "refId": "A"
        }
      ],
      "title": "Completed Jobs",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 8,
        "y": 0
      },
      "id": 4,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select count(distinct id) from ${table} where state = 'RUNNING' and eventType = '${eventType}'",
          "refId": "A"
        }
      ],
      "title": "Jobs Running",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 16,
        "y": 0
      },
      "id": 14,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select count(*) from ${table} where state = 'FAILED' and eventType = '${eventType}'",
          "refId": "A"
        }
      ],
      "title": "Failed Jobs",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": []
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 5
      },
      "id": 12,
      "options": {
        "displayLabels": [
          "value"
        ],
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true,
          "values": [
            "value"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^_col0$/",
          "values": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select count(*),eventType from ${table} group by eventType;",
          "refId": "A"
        }
      ],
      "title": "Total number of Jobs",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 5
      },
      "id": 6,
      "options": {
        "barRadius": 0,
        "barWidth": 0.97,
        "fullHighlight": false,
        "groupWidth": 0.7,
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "orientation": "auto",
        "showValue": "auto",
        "stacking": "none",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        },
        "xTickLabelRotation": 0,
        "xTickLabelSpacing": 0
      },
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select count(1) as totaljobs, resourcetype from ${table} where eventtype = '${eventType}' group by resourcetype",
          "refId": "A"
        }
      ],
      "title": "Jobs per resource",
      "type": "barchart"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": [],
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 13
      },
      "id": 18,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "values": [
            "percent"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^percentJobs$/",
          "values": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select COUNT(*) as percentJobs,resourcetype from ${table} where eventtype = '${eventType}' group by resourcetype\n",
          "refId": "A"
        }
      ],
      "title": "Jobs by Resourcetype",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 13
      },
      "id": 10,
      "options": {
        "barRadius": 0,
        "barWidth": 0.97,
        "fullHighlight": false,
        "groupWidth": 0.7,
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "orientation": "auto",
        "showValue": "auto",
        "stacking": "none",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        },
        "xTickLabelRotation": 0,
        "xTickLabelSpacing": 0
      },
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select cast(sum(cast(backupsizeinbytes as decimal(22,2)))/1024/1024 as bigint) as totalsizeinMB,resourcetype from (select * from ${table} where eventtype = '${eventType}' AND resourcetype is not null) group by resourcetype",
          "refId": "A"
        }
      ],
      "title": "BackupsizeByresource",
      "type": "barchart"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": []
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 21
      },
      "id": 20,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select cast(sum(cast(backupsizeinbytes as decimal(22,2)))/1024/1024 as bigint) as totalsizeinMB,resourcetype from (select * from ${table} where eventtype = '${eventType}' AND  resourcetype is not null) group by resourcetype",
          "refId": "A"
        }
      ],
      "title": "BackupsizeByresource",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "grafana-athena-datasource",
        "uid": "B-kATqGSk"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "id": 16,
      "options": {
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "datasource": {
            "type": "grafana-athena-datasource",
            "uid": "B-kATqGSk"
          },
          "format": 1,
          "rawSQL": "select  resourcetype,state,statusmessage from ${table} where  eventType = '${eventType}'",
          "refId": "A"
        }
      ],
      "title": "Job Details",
      "type": "table"
    }
  ],
  "refresh": "",
  "revision": 1,
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "Amazon Athena",
          "value": "Amazon Athena"
        },
        "hide": 0,
        "includeAll": false,
        "label": "datasource",
        "multi": false,
        "name": "datasource",
        "options": [],
        "query": "grafana-athena-datasource",
        "queryValue": "",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {
          "selected": false,
          "text": "aws-backup-event-records",
          "value": "aws-backup-event-records"
        },
        "datasource": {
          "type": "grafana-athena-datasource",
          "uid": "B-kATqGSk"
        },
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "database",
        "multi": false,
        "name": "database",
        "options": [],
        "query": {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "format": 1,
          "rawSQL": "show databases"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "grafana_view2",
          "value": "grafana_view2"
        },
        "datasource": {
          "type": "grafana-athena-datasource",
          "uid": "B-kATqGSk"
        },
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "table",
        "multi": false,
        "name": "table",
        "options": [],
        "query": {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "format": 1,
          "rawSQL": "Show tables"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "Backup Job State Change",
          "value": "Backup Job State Change"
        },
        "datasource": {
          "type": "grafana-athena-datasource",
          "uid": "B-kATqGSk"
        },
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "eventType",
        "options": [],
        "query": {
          "connectionArgs": {
            "catalog": "__default",
            "database": "__default",
            "region": "__default",
            "resultReuseEnabled": false,
            "resultReuseMaxAgeInMinutes": 60
          },
          "format": 1,
          "rawSQL": "select distinct \"detail-type\" from aws_backup_events_records_711031701858_us_east_1"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "AWS_Backup",
  "uid": "FIKWak7Sz",
  "version": 23,
  "weekStart": ""
}

