Grafana dashboard: PosgreSQL DB/Table Size Details (Designed for PMM)
Description: We take a look at using an catalog called pg_class. The catalog pg_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes, sequences, views, materialized views, composite types, and TOAST tables.

The dashboard is prepared for PMM2.

Metrics are collected by a custom query. It's used postgresql_exporter (https://github.com/percona/postgres_exporter). 
So we need create a file with a custom query. Postgresql exporter is processing custom queries files by default. So you should place your file into one of next path refer to a desired scraping interval and restart the exporter.

/usr/local/percona/pmm2/collectors/custom-queries/postgresql/low-resolution

/usr/local/percona/pmm2/collectors/custom-queries/postgresql/medium-resolution

/usr/local/percona/pmm2/collectors/custom-queries/postgresql/high-resolution

We propose to use our bash script (https://gist.github.com/adivinho/12641a0d2fda105c00e5aa6bf2bdce09) that generates a query and forms other fields for a custom query file. You have to specify the database name, or names, that will be monitored. You can store the result of the script in a separate file or can extend an existing file with queries.

$ ./postgres_query_size_generator.sh sbtest sbtest2 >> queries-postgres-2.yml

Next metrics are collected:
* pg_class_table_rows
* pg_class_disk_usage_table_bytes
* pg_class_disk_usage_index_bytes
* pg_class_disk_usage_toast_bytes

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "digiapulssi-breadcrumb-panel",
      "name": "Breadcrumb",
      "version": "1.1.6"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.1"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.4.0"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": false,
        "iconColor": "#e0752d",
        "limit": 100,
        "matchAny": true,
        "name": "PMM Annotations",
        "showIn": 0,
        "tags": [
          "pmm_annotation",
          "$host",
          "$service"
        ],
        "type": "tags"
      },
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "#6ed0e0",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "tags": [],
        "type": "dashboard"
      }
    ]
  },
  "description": "We take a look at using an catalog called pg_class. The catalog pg_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes, sequences, views, materialized views, composite types, and TOAST tables.",
  "editable": true,
  "gnetId": 11872,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1584696001972,
  "links": [
    {
      "icon": "doc",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "Home"
      ],
      "targetBlank": false,
      "title": "Home",
      "type": "link",
      "url": "/graph/d/pmm-home/home-dashboard"
    },
    {
      "icon": "dashboard",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "Query Analytics"
      ],
      "targetBlank": false,
      "title": "Query Analytics",
      "type": "link",
      "url": "/graph/d/pmm-qan/pmm-query-analytics"
    },
    {
      "icon": "bolt",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "Compare"
      ],
      "targetBlank": false,
      "title": "Compare",
      "type": "link",
      "url": "/graph/d/node-instance-compare/nodes-compare"
    },
    {
      "asDropdown": true,
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "OS"
      ],
      "targetBlank": false,
      "title": "OS",
      "type": "dashboards"
    },
    {
      "asDropdown": true,
      "includeVars": false,
      "keepTime": true,
      "tags": [
        "Services"
      ],
      "targetBlank": false,
      "title": "Services",
      "type": "dashboards"
    },
    {
      "asDropdown": true,
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "PMM"
      ],
      "targetBlank": false,
      "title": "PMM",
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "breadcrumbItemsMaxAmount": "6",
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 2,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hideTextInRootDashboard": false,
      "id": 999,
      "isRootDashboard": false,
      "links": [],
      "options": {},
      "targets": [
        {
          "expr": "",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": " ",
      "transparent": true,
      "type": "digiapulssi-breadcrumb-panel"
    },
    {
      "collapsed": false,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 2
      },
      "id": 1013,
      "panels": [],
      "title": "All Databases",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": "${DS_PROMETHEUS}",
      "description": "",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 3
      },
      "id": 1039,
      "interval": "",
      "options": {},
      "pageSize": null,
      "showHeader": true,
      "sort": {
        "col": 2,
        "desc": true
      },
      "styles": [
        {
          "alias": "Database",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Metric",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Time",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "Size",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value",
          "thresholds": [],
          "type": "number",
          "unit": "bytes"
        }
      ],
      "targets": [
        {
          "expr": "sum by (datname) (pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"})",
          "instant": true,
          "interval": "$interval",
          "legendFormat": "{{datname}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Disk Usage",
      "transform": "timeseries_to_rows",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "",
      "editable": true,
      "error": false,
      "fill": 2,
      "fillGradient": 0,
      "grid": {},
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 3
      },
      "hiddenSeries": false,
      "id": 1062,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "hideEmpty": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sort": "avg",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "calculatedInterval": "2m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "sum by (datname) (pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"})",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "legendFormat": "{{datname}}",
          "metric": "",
          "refId": "A",
          "step": 300,
          "target": ""
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Disk Usage Size by Databases",
      "tooltip": {
        "msResolution": false,
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "bytes",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "max": null,
          "min": 0,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "",
      "editable": true,
      "error": false,
      "fill": 2,
      "fillGradient": 0,
      "grid": {},
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 11
      },
      "hiddenSeries": false,
      "id": 1016,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "hideEmpty": false,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "sort": "avg",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "calculatedInterval": "2m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "sum by (datname) (rate(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval]) or irate(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[5m]))",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "legendFormat": "{{datname}}",
          "metric": "",
          "refId": "A",
          "step": 300,
          "target": ""
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Disk Usage Rate by Databases",
      "tooltip": {
        "msResolution": false,
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "bytes",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "max": null,
          "min": 0,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {
        "sbtest - sbtest2": "dark-yellow"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "",
      "editable": true,
      "error": false,
      "fill": 6,
      "fillGradient": 0,
      "grid": {},
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 19
      },
      "hiddenSeries": false,
      "id": 1063,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "hideEmpty": false,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "sort": "avg",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 1,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "topk(10,(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"} - pg_class_disk_usage_index_bytes{datname=~\"$db\",service_name=~\"$service_name\"} - pg_class_disk_usage_toast_bytes{datname=~\"$db\",service_name=~\"$service_name\"}) > 0)",
          "interval": "$interval",
          "legendFormat": "{{datname}} - {{relname}}",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Top 10 Disk Usage Size by Tables",
      "tooltip": {
        "msResolution": false,
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "bytes",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "max": null,
          "min": 0,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {
        "sbtest - sbtest2": "dark-yellow"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "",
      "editable": true,
      "error": false,
      "fill": 2,
      "fillGradient": 0,
      "grid": {},
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 27
      },
      "hiddenSeries": false,
      "id": 1061,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "hideEmpty": false,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "sort": "avg",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "paceLength": 10,
      "percentage": false,
      "pointradius": 1,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "calculatedInterval": "2m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "topk(10,(rate(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval]) or irate(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[5m]))>0)",
          "format": "time_series",
          "hide": true,
          "interval": "$interval",
          "intervalFactor": 1,
          "legendFormat": "{{datname}} - {{relname}}",
          "metric": "",
          "refId": "A",
          "step": 300,
          "target": ""
        },
        {
          "expr": "topk(10,((rate(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval]) - rate(pg_class_disk_usage_index_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval]) - rate(pg_class_disk_usage_toast_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval])) or (irate(pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[5m]) - irate(pg_class_disk_usage_index_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval]) - irate(pg_class_disk_usage_toast_bytes{datname=~\"$db\",service_name=~\"$service_name\"}[$interval])))>0)",
          "hide": false,
          "interval": "$interval",
          "legendFormat": "{{datname}} - {{relname}}",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Disk Usage Rate by Tables",
      "tooltip": {
        "msResolution": false,
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "bytes",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "max": null,
          "min": 0,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 35
      },
      "id": 1052,
      "interval": null,
      "legend": {
        "show": true,
        "sort": "current",
        "sortDesc": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "options": {},
      "pieType": "pie",
      "pluginVersion": "6.5.1",
      "strokeWidth": 1,
      "targets": [
        {
          "expr": "topk(5,pg_class_table_rows{datname=~\"$db\",service_name=~\"$service_name\"})",
          "interval": "$interval",
          "legendFormat": "{{datname}} - {{relname}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top Tables by  Rows",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "fontSize": "80%",
      "format": "bytes",
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 35
      },
      "id": 1041,
      "interval": null,
      "legend": {
        "header": "",
        "show": true,
        "sort": "current",
        "sortDesc": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "options": {},
      "pieType": "pie",
      "pluginVersion": "6.5.1",
      "strokeWidth": 1,
      "targets": [
        {
          "expr": "topk(5,pg_class_disk_usage_table_bytes{datname=~\"$db\",service_name=~\"$service_name\"} - pg_class_disk_usage_index_bytes{datname=~\"$db\",service_name=~\"$service_name\"} - pg_class_disk_usage_toast_bytes{datname=~\"$db\",service_name=~\"$service_name\"})\n",
          "interval": "$interval",
          "legendFormat": "{{datname}} - {{relname}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top Tables by  Size",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "fontSize": "80%",
      "format": "bytes",
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 42
      },
      "id": 1053,
      "interval": null,
      "legend": {
        "header": "",
        "show": true,
        "sort": "current",
        "sortDesc": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "options": {},
      "pieType": "pie",
      "pluginVersion": "6.5.1",
      "strokeWidth": 1,
      "targets": [
        {
          "expr": "topk(5,pg_class_disk_usage_index_bytes{datname=~\"$db\",service_name=~\"$service_name\"})",
          "interval": "$interval",
          "legendFormat": "{{datname}} - {{relname}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top Tables by  Index",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "fontSize": "80%",
      "format": "bytes",
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 42
      },
      "id": 1054,
      "interval": null,
      "legend": {
        "show": true,
        "sort": "current",
        "sortDesc": true,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "options": {},
      "pieType": "pie",
      "pluginVersion": "6.5.1",
      "strokeWidth": 1,
      "targets": [
        {
          "expr": "topk(5,pg_class_disk_usage_toast_bytes{datname=~\"$db\",service_name=~\"$service_name\"})\n",
          "interval": "$interval",
          "legendFormat": "{{datname}} - {{relname}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top Tables by  Toast",
      "type": "grafana-piechart-panel",
      "valueName": "current"
    }
  ],
  "refresh": "1m",
  "schemaVersion": 21,
  "style": "dark",
  "tags": [
    "Percona",
    "Posgresql"
  ],
  "templating": {
    "list": [
      {
        "allFormat": "glob",
        "auto": true,
        "auto_count": 200,
        "auto_min": "1s",
        "current": {
          "selected": false,
          "text": "auto",
          "value": "$__auto_interval_interval"
        },
        "datasource": "Prometheus",
        "hide": 0,
        "includeAll": false,
        "label": "Interval",
        "multi": false,
        "multiFormat": "glob",
        "name": "interval",
        "options": [
          {
            "selected": true,
            "text": "auto",
            "value": "$__auto_interval_interval"
          },
          {
            "selected": false,
            "text": "1s",
            "value": "1s"
          },
          {
            "selected": false,
            "text": "5s",
            "value": "5s"
          },
          {
            "selected": false,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "5m",
            "value": "5m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          }
        ],
        "query": "1s,5s,1m,5m,1h,6h,1d",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      },
      {
        "allFormat": "glob",
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(pg_up,node_name)",
        "hide": 0,
        "includeAll": true,
        "label": "Node Name",
        "multi": true,
        "multiFormat": "regex values",
        "name": "node_name",
        "options": [],
        "query": "label_values(pg_up,node_name)",
        "refresh": 2,
        "refresh_on_load": false,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "instance",
        "tags": [],
        "tagsQuery": "up",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(pg_up{node_name=~\"$node_name\"}, service_name)",
        "hide": 0,
        "includeAll": true,
        "label": "Service Name",
        "multi": true,
        "name": "service_name",
        "options": [],
        "query": "label_values(pg_up{node_name=~\"$node_name\"}, service_name)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(pg_stat_database_tup_fetched{service_name=~\"$service_name\",datname!~\"template.*|postgres\"},datname)",
        "hide": 0,
        "includeAll": true,
        "label": "Database",
        "multi": true,
        "name": "db",
        "options": [],
        "query": "label_values(pg_stat_database_tup_fetched{service_name=~\"$service_name\",datname!~\"template.*|postgres\"},datname)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-12h",
    "to": "now"
  },
  "timepicker": {
    "collapse": false,
    "enable": true,
    "hidden": false,
    "notice": false,
    "now": true,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "status": "Stable",
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ],
    "type": "timepicker"
  },
  "timezone": "browser",
  "title": "PosgreSQL DB/Table Size Details (Designed for PMM)",
  "uid": "MZmZAj-Zk",
  "version": 3
}