apiVersion: v1
data:
  postgresql_overview.json: |-
   {
     "__inputs": [
       {
         "name": "DS_PROMETHEUS",
         "label": "PROMETHEUS",
         "description": "",
         "type": "datasource",
         "pluginId": "prometheus",
         "pluginName": "Prometheus"
       }
     ],
     "__requires": [
       {
         "type": "grafana",
         "id": "grafana",
         "name": "Grafana",
         "version": "7.4.5"
       },
       {
         "type": "datasource",
         "id": "prometheus",
         "name": "Prometheus",
         "version": "1.0.0"
       },
       {
         "type": "panel",
         "id": "stat",
         "name": "Stat",
         "version": ""
       }
     ],
     "annotations": {
       "list": [
         {
           "builtIn": 1,
           "datasource": "-- Grafana --",
           "enable": true,
           "hide": true,
           "iconColor": "rgba(0, 211, 255, 1)",
           "name": "Annotations & Alerts",
           "type": "dashboard"
         }
       ]
     },
     "editable": false,
     "gnetId": null,
     "graphTooltip": 0,
     "id": null,
     "iteration": 1625069480601,
     "links": [],
     "panels": [
       {
         "cacheTimeout": null,
         "datasource": "Prometheus",
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "custom": {},
             "links": [
               {
                 "targetBlank": true,
                 "title": "Cluster Details",
                 "url": "dashboard/db/postgresqldetails?$__all_variables"
               },
               {
                 "targetBlank": true,
                 "title": "Backup Details",
                 "url": "dashboard/db/pgbackrest?$__all_variables"
               },
               {
                 "targetBlank": true,
                 "title": "POD Details",
                 "url": "dashboard/db/pod-details?$__all_variables"
               },
               {
                 "targetBlank": true,
                 "title": "Query Statistics",
                 "url": "dashboard/db/query-statistics?$__all_variables"
               },
               {
                 "targetBlank": true,
                 "title": "Service Health",
                 "url": "dashboard/db/postgresql-service-health?$__all_variables"
               }
             ],
             "mappings": [
               {
                 "from": "0",
                 "id": 0,
                 "text": "DOWN",
                 "to": "99",
                 "type": 2
               },
               {
                 "from": "100",
                 "id": 1,
                 "text": "Standalone Cluster",
                 "to": "199",
                 "type": 2
               },
               {
                 "from": "200",
                 "id": 2,
                 "text": "HA CLUSTER",
                 "to": "1000",
                 "type": 2
               }
             ],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "#bf1b00",
                   "value": null
                 },
                 {
                   "color": "#eab839",
                   "value": 10
                 },
                 {
                   "color": "#56A64B",
                   "value": 100
                 }
               ]
             },
             "unit": "short"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 2,
           "w": 12,
           "x": 0,
           "y": 0
         },
         "id": 1,
         "interval": null,
         "links": [],
         "maxDataPoints": 100,
         "maxPerRow": 2,
         "options": {
           "colorMode": "background",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "horizontal",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {
             "valueSize": 30
           },
           "textMode": "auto"
         },
         "pluginVersion": "7.4.5",
         "repeat": "cluster",
         "repeatDirection": "h",
         "targets": [
           {
             "$hashKey": "object:243",
             "expr": "sum(pg_up{pg_cluster=~\"$cluster\"})*100+sum(ccp_is_in_recovery_status{pg_cluster=~\"$cluster\"})",
             "format": "time_series",
             "interval": "",
             "intervalFactor": 1,
             "legendFormat": "{{cluster}}",
             "metric": "up",
             "refId": "A",
             "step": 2
           }
         ],
         "title": "$cluster - Overview",
         "type": "stat"
       }
     ],
     "refresh": "5m",
     "schemaVersion": 27,
     "style": "dark",
     "tags": [],
     "templating": {
       "list": [
         {
           "allFormat": "glob",
           "allValue": null,
           "current": {},
           "datasource": "Prometheus",
           "definition": "label_values(pg_cluster)",
           "description": null,
           "error": null,
           "hide": 1,
           "includeAll": true,
           "label": "cluster",
           "multi": true,
           "name": "cluster",
           "options": [],
           "query": {
             "query": "label_values(pg_cluster)",
             "refId": "PROMETHEUS-cluster-Variable-Query"
           },
           "refresh": 1,
           "regex": "",
           "skipUrlSync": false,
           "sort": 0,
           "tagValuesQuery": "",
           "tags": [],
           "tagsQuery": "",
           "type": "query",
           "useTags": false
         }
       ]
     },
     "time": {
       "from": "now-5m",
       "to": "now"
     },
     "timepicker": {
       "time_options": [
         "5m",
         "15m",
         "1h",
         "6h",
         "12h",
         "24h",
         "2d",
         "7d",
         "30d"
       ]
     },
     "timezone": "browser",
     "title": "PostgreSQL Overview",
     "uid": "D2X39SlGk",
     "version": 1
   }
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: grafana-dashboard-crunchy-postgresql-overview
