{{- if .Values.postgres_operator.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: cnpg-dashboard
  namespace: prometheus
  labels:
    grafana_dashboard: "1"
    app.kubernetes.io/instance: prometheus-community
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: grafana
    app.kubernetes.io/version: 9.1.7
    helm.sh/chart: grafana-6.40.4
data:
  cnp.json: |-
    {
        "annotations": {
          "list": [
            {
              "builtIn": 1,
              "datasource": "-- 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,
        "gnetId": null,
        "graphTooltip": 0,
        "iteration": 1637064390546,
        "links": [],
        "liveNow": false,
        "panels": [
          {
            "collapsed": false,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 0
            },
            "id": 12,
            "panels": [],
            "title": "Server Health",
            "type": "row"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 3,
              "x": 0,
              "y": 1
            },
            "id": 191,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Instance",
            "transparent": true,
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 2,
              "x": 3,
              "y": 1
            },
            "id": 192,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Status",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 4,
              "x": 5,
              "y": 1
            },
            "id": 193,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Clustering / replicas",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 5,
              "x": 9,
              "y": 1
            },
            "id": 195,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Connections",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 3,
              "x": 14,
              "y": 1
            },
            "id": 196,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Max Connections",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "description": "",
            "gridPos": {
              "h": 1,
              "w": 3,
              "x": 17,
              "y": 1
            },
            "id": 197,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Wraparound",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 2,
              "x": 20,
              "y": 1
            },
            "id": 313,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Started",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 2,
              "x": 22,
              "y": 1
            },
            "id": 198,
            "options": {
              "content": "",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "title": "Server Version",
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 3,
              "w": 3,
              "x": 0,
              "y": 2
            },
            "id": 61,
            "options": {
              "content": "<table style=\"width:100%; height:100%;border:0px solid black;\">\n  <td style=\"text-align: center;vertical-align: middle;border:0px solid black; \"><p style=\"font-weight: bold;\">$instances</p>\n  </td>\n</table>",
              "mode": "html"
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "type": "text"
          },
          {
            "datasource": "${DataSource}",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "mappings": [
                  {
                    "options": {
                      "0": {
                        "index": 0,
                        "text": "Down"
                      },
                      "1": {
                        "index": 1,
                        "text": "Up"
                      }
                    },
                    "type": "value"
                  }
                ],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "green",
                      "value": 1
                    }
                  ]
                }
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 2,
              "x": 3,
              "y": 2
            },
            "id": 33,
            "options": {
              "colorMode": "background",
              "graphMode": "area",
              "justifyMode": "auto",
              "orientation": "auto",
              "reduceOptions": {
                "calcs": [
                  "lastNotNull"
                ],
                "fields": "",
                "values": false
              },
              "text": {},
              "textMode": "value"
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "",
                "refId": "A"
              }
            ],
            "type": "stat"
          },
          {
            "datasource": "${DataSource}",
            "description": "",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "mappings": [
                  {
                    "options": {
                      "0": {
                        "color": "red",
                        "index": 1,
                        "text": "No"
                      },
                      "1": {
                        "color": "green",
                        "index": 0,
                        "text": "Yes"
                      }
                    },
                    "type": "value"
                  }
                ],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                }
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 2,
              "x": 5,
              "y": 2
            },
            "id": 60,
            "options": {
              "colorMode": "background",
              "graphMode": "area",
              "justifyMode": "auto",
              "orientation": "auto",
              "reduceOptions": {
                "calcs": [
                  "lastNotNull"
                ],
                "fields": "",
                "values": false
              },
              "text": {},
              "textMode": "value"
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "1 - cnpg_pg_replication_in_recovery{namespace=~\"$namespace\",pod=~\"$instances\"} + cnpg_pg_replication_is_wal_receiver_up{namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "transformations": [],
            "type": "stat"
          },
          {
            "datasource": "${DataSource}",
            "description": "",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                }
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 2,
              "x": 7,
              "y": 2
            },
            "id": 229,
            "options": {
              "colorMode": "value",
              "graphMode": "none",
              "justifyMode": "auto",
              "orientation": "auto",
              "reduceOptions": {
                "calcs": [
                  "lastNotNull"
                ],
                "fields": "",
                "values": false
              },
              "text": {},
              "textMode": "value"
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "cnpg_pg_replication_streaming_replicas{namespace=~\"$namespace\",pod=~\"$instances\"}",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "transformations": [],
            "type": "stat"
          },
          {
            "datasource": "${DataSource}",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "palette-classic"
                },
                "custom": {
                  "axisLabel": "",
                  "axisPlacement": "auto",
                  "barAlignment": 0,
                  "drawStyle": "line",
                  "fillOpacity": 10,
                  "gradientMode": "none",
                  "hideFrom": {
                    "legend": false,
                    "tooltip": false,
                    "viz": false
                  },
                  "lineInterpolation": "linear",
                  "lineWidth": 1,
                  "pointSize": 5,
                  "scaleDistribution": {
                    "type": "linear"
                  },
                  "showPoints": "never",
                  "spanNulls": true,
                  "stacking": {
                    "group": "A",
                    "mode": "none"
                  },
                  "thresholdsStyle": {
                    "mode": "off"
                  }
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    }
                  ]
                },
                "unit": "short"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 5,
              "x": 9,
              "y": 2
            },
            "id": 58,
            "options": {
              "legend": {
                "calcs": [
                  "last",
                  "mean"
                ],
                "displayMode": "list",
                "placement": "bottom"
              },
              "tooltip": {
                "mode": "single"
              }
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "sum by (pod) (cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"})",
                "instant": false,
                "interval": "",
                "legendFormat": "-",
                "refId": "A"
              }
            ],
            "type": "timeseries"
          },
          {
            "datasource": "${DataSource}",
            "description": "",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "decimals": 0,
                "mappings": [],
                "max": 100,
                "noValue": "<1%",
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "#EAB839",
                      "value": 75
                    },
                    {
                      "color": "red",
                      "value": 90
                    }
                  ]
                },
                "unit": "percent"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 3,
              "x": 14,
              "y": 2
            },
            "id": 32,
            "options": {
              "orientation": "horizontal",
              "reduceOptions": {
                "calcs": [
                  "last"
                ],
                "fields": "",
                "values": false
              },
              "showThresholdLabels": false,
              "showThresholdMarkers": true,
              "text": {}
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "100 * sum by (pod) (cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"}) / sum by (pod) (cnpg_pg_settings_setting{name=\"max_connections\",namespace=~\"$namespace\",pod=~\"$instances\"})",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "type": "gauge"
          },
          {
            "datasource": "${DataSource}",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "mappings": [],
                "max": 2147483647,
                "min": 0,
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "#EAB839",
                      "value": 200000000
                    },
                    {
                      "color": "red",
                      "value": 1000000000
                    }
                  ]
                },
                "unit": "none"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 3,
              "x": 17,
              "y": 2
            },
            "id": 8,
            "options": {
              "displayMode": "lcd",
              "orientation": "horizontal",
              "reduceOptions": {
                "calcs": [
                  "lastNotNull"
                ],
                "fields": "",
                "values": false
              },
              "showUnfilled": true,
              "text": {}
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": true,
                "expr": "max by (pod) (cnpg_pg_database_xid_age{namespace=~\"$namespace\",pod=~\"$instances\"})",
                "instant": true,
                "interval": "",
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "type": "bargauge"
          },
          {
            "datasource": "${DataSource}",
            "description": "",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-blue",
                      "value": null
                    }
                  ]
                },
                "unit": "dateTimeFromNow"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 2,
              "x": 20,
              "y": 2
            },
            "id": 314,
            "options": {
              "colorMode": "background",
              "graphMode": "none",
              "justifyMode": "auto",
              "orientation": "horizontal",
              "reduceOptions": {
                "calcs": [
                  "lastNotNull"
                ],
                "fields": "",
                "values": false
              },
              "text": {},
              "textMode": "value"
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": false,
                "expr": "cnpg_pg_postmaster_start_time{namespace=~\"$namespace\",pod=~\"$instances\"}*1000",
                "format": "time_series",
                "hide": false,
                "instant": true,
                "interval": "",
                "intervalFactor": 1,
                "legendFormat": "",
                "refId": "A"
              }
            ],
            "transformations": [],
            "type": "stat"
          },
          {
            "datasource": "${DataSource}",
            "description": "",
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "thresholds"
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-blue",
                      "value": null
                    }
                  ]
                },
                "unit": "string"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 3,
              "w": 2,
              "x": 22,
              "y": 2
            },
            "id": 42,
            "options": {
              "colorMode": "background",
              "graphMode": "none",
              "justifyMode": "auto",
              "orientation": "horizontal",
              "reduceOptions": {
                "calcs": [
                  "lastNotNull"
                ],
                "fields": "",
                "values": false
              },
              "text": {},
              "textMode": "value"
            },
            "pluginVersion": "8.2.1",
            "repeat": "instances",
            "repeatDirection": "v",
            "targets": [
              {
                "exemplar": false,
                "expr": "cnpg_collector_postgres_version{namespace=~\"$namespace\",pod=~\"$instances\"}",
                "format": "time_series",
                "hide": false,
                "instant": true,
                "interval": "",
                "intervalFactor": 1,
                "legendFormat": "{{`{{pod}}`}}",
                "refId": "A"
              }
            ],
            "transformations": [],
            "type": "stat"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 11
            },
            "id": 41,
            "panels": [
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 0,
                  "y": 6
                },
                "id": 187,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Instance",
                "transparent": true,
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 3,
                  "y": 6
                },
                "id": 183,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Max Connections",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 6,
                  "y": 6
                },
                "id": 184,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Shared Buffers",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 9,
                  "y": 6
                },
                "id": 185,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Effective Cache Size",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 12,
                  "y": 6
                },
                "id": 186,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Work Mem",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 15,
                  "y": 6
                },
                "id": 188,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Maintenance Work Mem",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 18,
                  "y": 6
                },
                "id": 189,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Random Page Cost",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 1,
                  "w": 3,
                  "x": 21,
                  "y": 6
                },
                "id": 190,
                "options": {
                  "content": "",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Sequential Page Cost",
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 0,
                  "y": 7
                },
                "id": 86,
                "options": {
                  "content": "<table style=\"width:100%; height:100%;border:0px solid black;\">\n  <td style=\"text-align: center;vertical-align: middle;border:0px solid black; \"><p style=\"font-weight: bold;\">$instances</p>\n  </td>\n</table>",
                  "mode": "html"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "text"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 3,
                  "y": 7
                },
                "id": 30,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{name=\"max_connections\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    },
                    "unit": "bytes"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 6,
                  "y": 7
                },
                "id": 24,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "max by (pod) (cnpg_pg_settings_setting{name=\"shared_buffers\",namespace=~\"$namespace\",pod=~\"$instances\"}) * max by (pod) (cnpg_pg_settings_setting{name=\"block_size\",namespace=~\"$namespace\",pod=~\"$instances\"})",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    },
                    "unit": "bytes"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 9,
                  "y": 7
                },
                "id": 57,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{name=\"effective_cache_size\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    },
                    "unit": "bytes"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 12,
                  "y": 7
                },
                "id": 26,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{name=\"work_mem\",namespace=~\"$namespace\",pod=~\"$instances\"} * 1024",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    },
                    "unit": "bytes"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 15,
                  "y": 7
                },
                "id": 47,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{name=\"maintenance_work_mem\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    },
                    "unit": "none"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 18,
                  "y": 7
                },
                "id": 48,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{name=\"random_page_cost\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    },
                    "unit": "none"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 3,
                  "w": 3,
                  "x": 21,
                  "y": 7
                },
                "id": 56,
                "options": {
                  "colorMode": "background",
                  "graphMode": "none",
                  "justifyMode": "auto",
                  "orientation": "horizontal",
                  "reduceOptions": {
                    "calcs": [
                      "lastNotNull"
                    ],
                    "fields": "",
                    "values": false
                  },
                  "text": {},
                  "textMode": "value"
                },
                "pluginVersion": "8.2.1",
                "repeat": "instances",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{name=\"seq_page_cost\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "type": "stat"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "thresholds"
                    },
                    "custom": {
                      "align": "auto",
                      "displayMode": "auto",
                      "filterable": true
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "dark-purple",
                          "value": null
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 9,
                  "w": 24,
                  "x": 0,
                  "y": 10
                },
                "id": 150,
                "options": {
                  "showHeader": true,
                  "sortBy": [
                    {
                      "desc": true,
                      "displayName": "parameter"
                    }
                  ]
                },
                "pluginVersion": "8.2.1",
                "repeatDirection": "v",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_settings_setting{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "format": "table",
                    "instant": true,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Configurations",
                "transformations": [
                  {
                    "id": "organize",
                    "options": {
                      "excludeByName": {
                        "Time": true,
                        "__name__": true,
                        "container": true,
                        "endpoint": true,
                        "instance": true,
                        "job": true,
                        "name": false,
                        "namespace": true,
                        "pod": false
                      },
                      "indexByName": {
                        "Time": 0,
                        "Value": 9,
                        "__name__": 1,
                        "container": 2,
                        "endpoint": 3,
                        "instance": 4,
                        "job": 5,
                        "name": 7,
                        "namespace": 8,
                        "pod": 6
                      },
                      "renameByName": {
                        "__name__": "",
                        "name": "parameter"
                      }
                    }
                  }
                ],
                "type": "table"
              }
            ],
            "title": "Configuration",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 12
            },
            "id": 10,
            "panels": [
              {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": "${DataSource}",
                "fill": 1,
                "fillGradient": 0,
                "gridPos": {
                  "h": 7,
                  "w": 12,
                  "x": 0,
                  "y": 7
                },
                "hiddenSeries": false,
                "id": 273,
                "legend": {
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "show": true,
                  "total": false,
                  "values": false
                },
                "lines": true,
                "linewidth": 2,
                "links": [],
                "nullPointMode": "null as zero",
                "options": {
                  "alertThreshold": true
                },
                "percentage": false,
                "pluginVersion": "8.2.1",
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": false,
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{pod=~\"$instances\", namespace=~\"$namespace\"}) by (pod)",
                    "format": "time_series",
                    "interval": "",
                    "intervalFactor": 2,
                    "legendFormat": "{{`{{pod}}`}}",
                    "legendLink": null,
                    "refId": "A",
                    "step": 10
                  },
                  {
                    "exemplar": true,
                    "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{pod=~\"$instances\", namespace=~\"$namespace\"})",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "total",
                    "refId": "B"
                  }
                ],
                "thresholds": [],
                "timeFrom": null,
                "timeRegions": [],
                "timeShift": null,
                "title": "CPU Usage",
                "tooltip": {
                  "shared": true,
                  "sort": 2,
                  "value_type": "individual"
                },
                "type": "graph",
                "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": []
                },
                "yaxes": [
                  {
                    "$$hashKey": "object:189",
                    "format": "short",
                    "label": null,
                    "logBase": 1,
                    "max": null,
                    "min": 0,
                    "show": true
                  },
                  {
                    "$$hashKey": "object:190",
                    "format": "short",
                    "label": null,
                    "logBase": 1,
                    "max": null,
                    "min": null,
                    "show": false
                  }
                ],
                "yaxis": {
                  "align": false,
                  "alignLevel": null
                }
              },
              {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": "${DataSource}",
                "fill": 2,
                "fillGradient": 0,
                "gridPos": {
                  "h": 7,
                  "w": 12,
                  "x": 12,
                  "y": 7
                },
                "hiddenSeries": false,
                "id": 275,
                "legend": {
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "show": true,
                  "total": false,
                  "values": false
                },
                "lines": true,
                "linewidth": 2,
                "links": [],
                "nullPointMode": "null as zero",
                "options": {
                  "alertThreshold": true
                },
                "percentage": false,
                "pluginVersion": "8.2.1",
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [
                  {
                    "alias": "quota - requests",
                    "color": "#F2495C",
                    "dashes": true,
                    "fill": 0,
                    "hiddenSeries": true,
                    "hideTooltip": true,
                    "legend": true,
                    "linewidth": 2,
                    "stack": false
                  },
                  {
                    "alias": "quota - limits",
                    "color": "#FF9830",
                    "dashes": true,
                    "fill": 0,
                    "hiddenSeries": true,
                    "hideTooltip": true,
                    "legend": true,
                    "linewidth": 2,
                    "stack": false
                  }
                ],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": false,
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "sum(container_memory_working_set_bytes{pod=~\"$instances\", namespace=\"$namespace\", container!=\"\", image!=\"\"}) by (pod)",
                    "format": "time_series",
                    "interval": "",
                    "intervalFactor": 2,
                    "legendFormat": "{{`{{pod}}`}}",
                    "legendLink": null,
                    "refId": "A",
                    "step": 10
                  },
                  {
                    "exemplar": true,
                    "expr": "sum(container_memory_working_set_bytes{pod=~\"$instances\", namespace=\"$namespace\", container!=\"\", image!=\"\"})",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "total",
                    "refId": "B"
                  }
                ],
                "thresholds": [],
                "timeFrom": null,
                "timeRegions": [],
                "timeShift": null,
                "title": "Memory Usage (w/o cache)",
                "tooltip": {
                  "shared": true,
                  "sort": 2,
                  "value_type": "individual"
                },
                "type": "graph",
                "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": []
                },
                "yaxes": [
                  {
                    "$$hashKey": "object:246",
                    "format": "bytes",
                    "label": null,
                    "logBase": 1,
                    "max": null,
                    "min": 0,
                    "show": true
                  },
                  {
                    "$$hashKey": "object:247",
                    "format": "short",
                    "label": null,
                    "logBase": 1,
                    "max": null,
                    "min": null,
                    "show": false
                  }
                ],
                "yaxis": {
                  "align": false,
                  "alignLevel": null
                }
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "opacity",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 24,
                  "x": 0,
                  "y": 14
                },
                "id": 39,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "sum(cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"}) by (pod)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "total ({{`{{pod}}`}})",
                    "refId": "B"
                  },
                  {
                    "exemplar": true,
                    "expr": "sum(cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"}) by (state, pod)",
                    "interval": "",
                    "legendFormat": "{{`{{state}}`}} ({{`{{pod}}`}})",
                    "refId": "A"
                  }
                ],
                "title": "Session States",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "opacity",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 0,
                  "y": 22
                },
                "id": 50,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "sum(rate(cnpg_pg_stat_database_xact_commit{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])) by (pod)",
                    "interval": "",
                    "legendFormat": "committed ({{`{{pod}}`}})",
                    "refId": "A"
                  },
                  {
                    "exemplar": true,
                    "expr": "sum(rate(cnpg_pg_stat_database_xact_rollback{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])) by (pod)",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "rolled back ({{`{{pod}}`}})",
                    "refId": "B"
                  }
                ],
                "title": "Transactions [5m]",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "s"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 12,
                  "y": 22
                },
                "id": 4,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "max by (pod) (cnpg_backends_max_tx_duration_seconds{namespace=~\"$namespace\",pod=~\"$instances\"})",
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Longest Transaction",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 0,
                  "y": 30
                },
                "id": 55,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_deadlocks{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "instant": false,
                    "interval": "",
                    "legendFormat": "count ({{`{{pod}}`}})",
                    "refId": "B"
                  }
                ],
                "title": "Deadlocks [5m]",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "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": 30
                },
                "id": 54,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_backends_waiting_total{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Blocked Queries",
                "type": "timeseries"
              }
            ],
            "title": "Operational Stats",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 13
            },
            "id": 35,
            "panels": [
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 0,
                  "y": 35
                },
                "id": 44,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_tup_deleted{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "interval": "",
                    "legendFormat": "deleted ({{`{{pod}}`}})",
                    "refId": "A"
                  },
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_tup_inserted{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "inserted ({{`{{pod}}`}})",
                    "refId": "B"
                  },
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_tup_fetched{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "fetched ({{`{{pod}}`}})",
                    "refId": "C"
                  },
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_tup_returned{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "returned ({{`{{pod}}`}})",
                    "refId": "D"
                  },
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_tup_updated{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "updated ({{`{{pod}}`}})",
                    "refId": "E"
                  }
                ],
                "title": "Tuple I/O [5m]",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "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": 35
                },
                "id": 46,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_blks_hit{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "interval": "",
                    "legendFormat": "hit ({{`{{pod}}`}})",
                    "refId": "A"
                  },
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_blks_read{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "read ({{`{{pod}}`}})",
                    "refId": "B"
                  }
                ],
                "title": "Block I/O [5m]",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        }
                      ]
                    },
                    "unit": "decbytes"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 0,
                  "y": 43
                },
                "id": 22,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "pluginVersion": "8.0.5",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_database_size_bytes{datname!~\"template.*\",datname!=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "interval": "",
                    "legendFormat": " {{`{{pod}}`}}: {{`{{datname}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Database Size",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "decbytes"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 12,
                  "y": 43
                },
                "id": 2,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_database_temp_bytes{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "instant": false,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Temp Bytes [5m]",
                "type": "timeseries"
              }
            ],
            "title": "Storage & I/O",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 14
            },
            "id": 37,
            "panels": [
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 8,
                  "x": 0,
                  "y": 53
                },
                "id": 6,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_collector_pg_wal_archive_status{value=\"ready\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "interval": "",
                    "legendFormat": "ready ({{`{{pod}}`}})",
                    "refId": "A"
                  },
                  {
                    "exemplar": true,
                    "expr": "cnpg_collector_pg_wal_archive_status{value=\"done\",namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "done ({{`{{pod}}`}})",
                    "refId": "B"
                  }
                ],
                "title": "WAL Segment Archive Status",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    }
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 8,
                  "x": 8,
                  "y": 53
                },
                "id": 52,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_archiver_archived_count{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "interval": "",
                    "legendFormat": "archived ({{`{{pod}}`}})",
                    "refId": "A"
                  },
                  {
                    "exemplar": true,
                    "expr": "rate(cnpg_pg_stat_archiver_failed_count{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])",
                    "hide": false,
                    "interval": "",
                    "legendFormat": "failed ({{`{{pod}}`}})",
                    "refId": "B"
                  }
                ],
                "title": "Archiver Status [5m]",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "s"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 8,
                  "x": 16,
                  "y": 53
                },
                "id": 53,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_archiver_seconds_since_last_archival{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "interval": "",
                    "legendFormat": "age ({{`{{pod}}`}})",
                    "refId": "A"
                  }
                ],
                "title": "Last Archive Age",
                "type": "timeseries"
              }
            ],
            "title": "Write Ahead Log",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 15
            },
            "id": 18,
            "panels": [
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "line"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "#EAB839",
                          "value": 600
                        },
                        {
                          "color": "dark-red",
                          "value": 3600
                        }
                      ]
                    },
                    "unit": "s"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 6,
                  "x": 0,
                  "y": 6
                },
                "id": 16,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_replication_lag{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "instant": false,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Replication Lag",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "s"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 6,
                  "x": 6,
                  "y": 6
                },
                "id": 14,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_replication_write_lag_seconds{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}",
                    "instant": false,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}} -> {{`{{application_name}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Write Lag",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "s"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 6,
                  "x": 12,
                  "y": 6
                },
                "id": 59,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_replication_flush_lag_seconds{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}",
                    "instant": false,
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}} -> {{`{{application_name}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Flush Lag",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 10,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "s"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 8,
                  "w": 6,
                  "x": 18,
                  "y": 6
                },
                "id": 20,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_replication_replay_lag_seconds{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}",
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}} -> {{`{{application_name}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Replay Lag",
                "type": "timeseries"
              }
            ],
            "title": "Replication",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 16
            },
            "id": 231,
            "panels": [
              {
                "cards": {
                  "cardPadding": null,
                  "cardRound": null
                },
                "color": {
                  "cardColor": "#b4ff00",
                  "colorScale": "sqrt",
                  "colorScheme": "interpolateOranges",
                  "exponent": 0.5,
                  "mode": "spectrum"
                },
                "dataFormat": "timeseries",
                "datasource": "${DataSource}",
                "gridPos": {
                  "h": 8,
                  "w": 12,
                  "x": 0,
                  "y": 63
                },
                "heatmap": {},
                "hideZeroBuckets": false,
                "highlightCards": true,
                "id": 233,
                "legend": {
                  "show": false
                },
                "reverseYBuckets": false,
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_collector_collection_duration_seconds{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "interval": "",
                    "legendFormat": "",
                    "refId": "A"
                  }
                ],
                "title": "Collection Duration",
                "tooltip": {
                  "show": true,
                  "showHistogram": false
                },
                "type": "heatmap",
                "xAxis": {
                  "show": true
                },
                "xBucketNumber": null,
                "xBucketSize": null,
                "yAxis": {
                  "decimals": null,
                  "format": "s",
                  "logBase": 1,
                  "max": null,
                  "min": null,
                  "show": true,
                  "splitFactor": null
                },
                "yBucketBound": "auto",
                "yBucketNumber": null,
                "yBucketSize": null
              },
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 0,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "auto",
                      "spanNulls": false,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "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": 63
                },
                "id": 235,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_collector_last_collection_error{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Errors",
                "type": "timeseries"
              }
            ],
            "title": "Collector Stats",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 17
            },
            "id": 239,
            "panels": [
              {
                "datasource": "${DataSource}",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": 0,
                      "drawStyle": "line",
                      "fillOpacity": 0,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "auto",
                      "spanNulls": false,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "dateTimeAsIso"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 6,
                  "w": 8,
                  "x": 0,
                  "y": 72
                },
                "id": 237,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "single"
                  }
                },
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_collector_first_recoverability_point{namespace=~\"$namespace\",pod=~\"$instances\"}*1000 > 0",
                    "format": "time_series",
                    "interval": "",
                    "legendFormat": "{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "First Recoverability Point",
                "type": "timeseries"
              }
            ],
            "title": "Backups",
            "type": "row"
          },
          {
            "collapsed": true,
            "datasource": "${DataSource}",
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 18
            },
            "id": 293,
            "panels": [
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": -1,
                      "drawStyle": "line",
                      "fillOpacity": 8,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "none"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 6,
                  "w": 5,
                  "x": 0,
                  "y": 79
                },
                "id": 295,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "multi"
                  }
                },
                "pluginVersion": "8.2.1",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_bgwriter_checkpoints_req{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "format": "time_series",
                    "hide": false,
                    "instant": false,
                    "interval": "",
                    "intervalFactor": 1,
                    "legendFormat": "req/{{`{{pod}}`}}",
                    "refId": "B"
                  },
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_bgwriter_checkpoints_timed{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "format": "time_series",
                    "interval": "",
                    "intervalFactor": 1,
                    "legendFormat": "timed/{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Requested/Timed",
                "type": "timeseries"
              },
              {
                "datasource": "${DataSource}",
                "description": "",
                "fieldConfig": {
                  "defaults": {
                    "color": {
                      "mode": "palette-classic"
                    },
                    "custom": {
                      "axisLabel": "",
                      "axisPlacement": "auto",
                      "barAlignment": -1,
                      "drawStyle": "line",
                      "fillOpacity": 8,
                      "gradientMode": "none",
                      "hideFrom": {
                        "legend": false,
                        "tooltip": false,
                        "viz": false
                      },
                      "lineInterpolation": "linear",
                      "lineWidth": 1,
                      "pointSize": 5,
                      "scaleDistribution": {
                        "type": "linear"
                      },
                      "showPoints": "never",
                      "spanNulls": true,
                      "stacking": {
                        "group": "A",
                        "mode": "none"
                      },
                      "thresholdsStyle": {
                        "mode": "off"
                      }
                    },
                    "mappings": [],
                    "thresholds": {
                      "mode": "absolute",
                      "steps": [
                        {
                          "color": "green",
                          "value": null
                        },
                        {
                          "color": "red",
                          "value": 80
                        }
                      ]
                    },
                    "unit": "ms"
                  },
                  "overrides": []
                },
                "gridPos": {
                  "h": 6,
                  "w": 5,
                  "x": 5,
                  "y": 79
                },
                "id": 296,
                "options": {
                  "legend": {
                    "calcs": [],
                    "displayMode": "list",
                    "placement": "bottom"
                  },
                  "tooltip": {
                    "mode": "multi"
                  }
                },
                "pluginVersion": "8.2.1",
                "targets": [
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_bgwriter_checkpoint_write_time{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "format": "time_series",
                    "hide": false,
                    "instant": false,
                    "interval": "",
                    "intervalFactor": 1,
                    "legendFormat": "write/{{`{{pod}}`}}",
                    "refId": "B"
                  },
                  {
                    "exemplar": true,
                    "expr": "cnpg_pg_stat_bgwriter_checkpoint_sync_time{namespace=~\"$namespace\",pod=~\"$instances\"}",
                    "format": "time_series",
                    "interval": "",
                    "intervalFactor": 1,
                    "legendFormat": "sync/{{`{{pod}}`}}",
                    "refId": "A"
                  }
                ],
                "title": "Write/Sync time",
                "type": "timeseries"
              }
            ],
            "title": "Checkpoints",
            "type": "row"
          }
        ],
        "refresh": "30s",
        "schemaVersion": 31,
        "style": "dark",
        "tags": [],
        "templating": {
          "list": [
            {
              "current": {
                "selected": false,
                "text": "Prometheus",
                "value": "Prometheus"
              },
              "description": null,
              "error": null,
              "hide": 0,
              "includeAll": false,
              "label": "Data Source",
              "multi": false,
              "name": "DataSource",
              "options": [],
              "query": "prometheus",
              "refresh": 1,
              "regex": "",
              "skipUrlSync": false,
              "type": "datasource"
            },
            {
              "allValue": null,
              "current": {
                "selected": false,
                "text": "default",
                "value": "default"
              },
              "datasource": "${DataSource}",
              "definition": "cnpg_collector_up",
              "description": null,
              "error": null,
              "hide": 0,
              "includeAll": false,
              "label": null,
              "multi": false,
              "name": "namespace",
              "options": [],
              "query": {
                "query": "cnpg_collector_up",
                "refId": "StandardVariableQuery"
              },
              "refresh": 1,
              "regex": "/namespace=\"(?<text>[^\"]+)/g",
              "skipUrlSync": false,
              "sort": 0,
              "type": "query"
            },
            {
              "allValue": null,
              "current": {
                "selected": false,
                "text": "cnp-sandbox",
                "value": "cnp-sandbox"
              },
              "datasource": "${DataSource}",
              "definition": "cnpg_collector_up{namespace=~\"$namespace\"}",
              "description": null,
              "error": null,
              "hide": 0,
              "includeAll": false,
              "label": null,
              "multi": false,
              "name": "cluster",
              "options": [],
              "query": {
                "query": "cnpg_collector_up{namespace=~\"$namespace\"}",
                "refId": "StandardVariableQuery"
              },
              "refresh": 1,
              "regex": "/cluster=\"(?<text>[^\"]+)/g",
              "skipUrlSync": false,
              "sort": 1,
              "type": "query"
            },
            {
              "allValue": null,
              "current": {
                "selected": true,
                "text": [
                  "All"
                ],
                "value": [
                  "$__all"
                ]
              },
              "datasource": "${DataSource}",
              "definition": "cnpg_collector_up{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}",
              "description": null,
              "error": null,
              "hide": 0,
              "includeAll": true,
              "label": null,
              "multi": true,
              "name": "instances",
              "options": [],
              "query": {
                "query": "cnpg_collector_up{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}",
                "refId": "StandardVariableQuery"
              },
              "refresh": 1,
              "regex": "/pod=\"(?<text>[^\"]+)/g",
              "skipUrlSync": false,
              "sort": 1,
              "type": "query"
            }
          ]
        },
        "time": {
          "from": "now-5m",
          "to": "now"
        },
        "timepicker": {
          "nowDelay": ""
        },
        "timezone": "",
        "title": "CloudNativePG",
        "uid": "z7FCA4Nnk",
        "version": 2
    }
{{- end }}
