{
  "annotations":{"list":[{"builtIn":1,"datasource":{"type":"datasource","uid":"grafana"},"enable":true,"hide":true,"iconColor":"rgba(0, 211, 255, 1)","name":"Annotations & Alerts","target":{"limit":100,"matchAny":false,"tags":[],"type":"dashboard"},"type":"dashboard"}]},
  "author":"Ruohang Feng (rh@vonng.com)",
  "description":"PostgreSQL Catalog Explorer for Single Instance",
  "editable":true,
  "fiscalYearStartMonth":0,
  "graphTooltip":0,
  "id":null,
  "license":"https://pigsty.io/docs/about/license/",
  "links":[
    { "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Overview"],"targetBlank":false,"title":"Overview","tooltip":"","type":"dashboards","url":"" },{ "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Cluster"] ,"targetBlank":false,"title":"Cluster" ,"tooltip":"","type":"dashboards","url":"" },
    { "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Instance"],"targetBlank":false,"title":"Instance","tooltip":"","type":"dashboards","url":"" },{ "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Database"],"targetBlank":false,"title":"Database","tooltip":"","type":"dashboards","url":"" }
  ],
  "panels":[
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":0},"id":74,"panels":[],"title":"Overview","type":"row"},
    {
      "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"mappings":[],"max":2.5,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"links","value":[{"title":"PGSQL Instance : ${ins}","url":"/d/pgsql-instance?var-ins=${ins}&${__url_time_range}"}]}] },{ "matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"links","value":[{"title":"PGSQL Cluster : ${cls}","url":"/d/pgsql-cluster?var-cls=${cls}&${__url_time_range}"}]}]   },
          { "matcher":{"id":"byFrameRefID","options":"C"},"properties":[{"id":"links","value":[{"title":"Node Instance : ${ip}","url":"/d/node-instance?var-id=${ip}&${__url_time_range}"}]}]      },{ "matcher":{"id":"byFrameRefID","options":"D"},"properties":[{"id":"links","value":[{"title":"Node Instance : ${node}","url":"/d/node-instance?var-id=${node}&${__url_time_range}"}]}]  }
        ]
      },
      "gridPos":{"h":6,"w":6,"x":0,"y":1},
      "id":183,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":true},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Instance","type":"string","values":["$ins"]}],"meta":{},"name":""} ,"hide":false,"refId":"A" },
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Cluster","type":"string","values":["${cls}"]}],"meta":{},"name":""},"hide":false,"refId":"B" },
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Node IP","type":"string","values":["${ip}"]}],"meta":{},"name":""} ,"hide":false,"refId":"C" },
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Hostname","type":"string","values":["${node}"]}],"meta":{}}        ,"hide":false,"refId":"D" }
      ],
      "title":"",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Replication Facts about this instance: In recovery, In sync commit mode, has replication descendant. has publication, has subscription",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[{"title":"PGSQL Replication for ${cls}","url":"/d/pgsql-replication?var-cls=${cls}&${__url_time_range}"}],"mappings":[],"max":2.5,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
        "overrides":[
          {"matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#3e668f","index":0,"text":"Primary"},"1":{"color":"#346f36cc","index":1,"text":"Replica"}},"type":"value"}]},{"id":"displayName","value":"Role"}]},
          {"matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#3e668f","index":0,"text":"No"},"1":{"color":"#346f36cc","index":1,"text":"Yes"}},"type":"value"}]}]},{"matcher":{"id":"byFrameRefID","options":"C"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1}]}}]},
          {
            "matcher":{"id":"byFrameRefID","options":"D"},
            "properties":[
              { "id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}                                                                                           },{ "id":"mappings"  ,"value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Upstream"},"1":{"color":"#346f36cc","index":1,"text":"Upstream"}},"type":"value"}]    },
              { "id":"links"     ,"value":[{"title":"Node Instance : ${__field.labels.sender_host}","url":"/d/node-instance?var-id=${__field.labels.sender_host}&${__url_time_range}"}] }
            ]
          },
          {"matcher":{"id":"byFrameRefID","options":"E"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1}]}}]},{"matcher":{"id":"byFrameRefID","options":"F"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1}]}}]}
        ]
      },
      "gridPos":{"h":6,"w":3,"x":6,"y":1},
      "id":174,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg_in_recovery{ins=\"$ins\"}"                                            ,             "instant":true,"interval":"","legendFormat":"recovery"         ,"queryType":"measurements","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg_recv_init_lsn{ins=\"$ins\"} > bool 0"                                 ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ sender_host }}","queryType":"measurements","refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg_sync_standby_enabled{ins=\"$ins\"}"                                   ,"hide":false,"instant":true,"interval":"","legendFormat":"sync"             ,"queryType":"measurements","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"count(pg_repl_lsn{ins=\"$ins\"}) or on() vector(0)"                      ,"hide":false,"instant":true,"interval":"","legendFormat":"children"         ,"queryType":"measurements","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"count by (ins)(pg_pubrel_count{ins=\"$ins\"}) > bool 0 or on() vector(0)","hide":false,"instant":true,"interval":"","legendFormat":"pub"              ,"queryType":"measurements","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"count by (ins)(pg_sub_id{ins=\"$ins\"}) or on() vector(0)"               ,"hide":false,"instant":true,"interval":"","legendFormat":"sub"              ,"queryType":"measurements","refId":"F" }
      ],
      "title":"",
      "type":"stat"
    },
    {
      "datasource":{"type":"postgres","uid":"${dsn}"},
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},
        "overrides":[
          { "matcher":{"id":"byName","options":"Roles"}    ,"properties":[{"id":"links","value":[{"title":"PGCAT Instance : Roles","url":"/d/pgcat-instance?var-dsn=${dsn:text}&${__url_time_range}&viewPanel=84"}]}]       },
          { "matcher":{"id":"byName","options":"Databases"},"properties":[{"id":"links","value":[{"title":"PGCAT Database : ${dsn:text}","url":"/d/pgcat-instance?var-dsn=${dsn:text}&${__url_time_range}&viewPanel=57"}]}] }
        ]
      },
      "gridPos":{"h":6,"w":7,"x":9,"y":1},
      "id":180,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"auto","wideLayout":true},
      "pluginVersion":"12.0.0",
      "targets":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "editorMode":"code",
          "format":"table",
          "group":[],
          "metricColumn":"none",
          "rawQuery":true,
          "rawSql":"SELECT *\nFROM (SELECT count(*) AS databases FROM pg_database) d,\n     (SELECT count(*) AS roles FROM pg_roles) r,\n     (SELECT count(*) AS tablespaces FROM pg_tablespace) tsp\n    -- (SELECT count(*) AS session FROM pg_stat_activity) proc,\n    -- (SELECT current_setting('max_connections')::INTEGER AS maxconn) mc\n;",
          "refId":"A",
          "select":[[{"params":["value"],"type":"column"}]],
          "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
          "timeColumn":"time",
          "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
        }
      ],
      "title":"",
      "transformations":[
        {
          "id":"organize",
          "options":{
            "excludeByName":{"current_setting":false,"indexes":true,"maxconn":false,"relations":true,"schemas":true,"sequences":true,"session":false,"views":true},
            "indexByName":{"databases":0,"maxconn":3,"roles":1,"session":4,"tablespaces":2},
            "renameByName":{
              "current_setting":"fsd",
              "databases":"Databases",
              "foreign_tables":"Foreign Tables",
              "indexes":"Indexes",
              "materialized_views":"Materialized Views",
              "maxconn":"MaxConn",
              "partitioned_indexes":"Partitioned Indexes",
              "partitioned_tables":"Partitioned Tables",
              "relations":"Relations",
              "roles":"Roles",
              "schemas":"Scheamas",
              "sequences":"Sequences",
              "session":"Processes",
              "tablespaces":"Tablespaces",
              "views":"Views"
            }
          }
        }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"All instances among pgsql cluster ${cls}\n\nInstance: Goto PGSQL Instance\n\nIP: Goto PGSQL Node\n\nStatus: Goto PGSQL Service\n\nLoad: max(cpu,postgres,pgbouncer)\n\nSpace: Disk space usage max(all device)\n\nProxy: session number, Goto Haproxy Admin Page",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"max":1.2,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
        "overrides":[
          {"matcher":{"id":"byName","options":"Instance"},"properties":[{"id":"links","value":[{"title":"PGCAT Instance ${__data.fields.Instance}.${datname}","url":"/d/pgcat-instance?var-dsn=${__data.fields.Instance}.${datname}"}]},{"id":"custom.width"}]},
          {"matcher":{"id":"byName","options":"IP"},"properties":[{"id":"custom.width","value":110},{"id":"links","value":[{"title":"Node Instance : ${__data.fields.IP}","url":"/d/node-instance?var-id=${__data.fields.IP}&${__url_time_range}"}]}]},
          {
            "matcher":{"id":"byName","options":"Role"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                             },{ "id":"mappings"          ,"value":[{"options":{"0":{"color":"#3e668f","index":0,"text":"primary"},"1":{"color":"#346f36cc","index":1,"text":"replica"}},"type":"value"}]         },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                  },{ "id":"links"             ,"value":[{"title":"PGSQL Service for ${cls}-${__data.fields.Role}","url":"/d/pgsql-service?var-svc=${cls}-${__data.fields.Role}&${__url_time_range}"}] }
            ]
          },{
            "matcher":{"id":"byName","options":"Load"},
            "properties":[
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"gauge"}                                                                                                                                                                                                         },
              { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                      },
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                              },
              { "id":"custom.width"      ,"value":120                                                                                                                                                                                                                                        },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":0.1},{"color":"#fcdb72","value":0.3},{"color":"#f79f64","value":0.5},{"color":"red","value":0.7},{"color":"#b783af","value":0.9},{"color":"text","value":1}]} },
              { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                          },
              { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"transparent","index":0,"text":"N/A"}},"type":"value"}]                                                                                                                                                         }
            ]
          },
          {"matcher":{"id":"byName","options":"Cluster"},"properties":[{"id":"links","value":[{"title":"PGSQL Cluster for ${__data.fields.Cluster}","url":"/d/pgsql-cluster?var-cls=${__data.fields.Cluster}&${__url_time_range}"}]}]},
          {
            "matcher":{"id":"byName","options":"Proxy"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                                 },
              { "id":"links"             ,"value":[{"targetBlank":true,"title":"HAProxy Admin Page : ${__data.fields.Instance}","url":"/haproxy/${__data.fields.Instance}/"}]                                                                                        },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"},{"color":"#3275d9bf","value":0},{"color":"#55a64bbf","value":1},{"color":"#f2cc0c","value":1000},{"color":"#f79f64","value":2000},{"color":"red","value":3000}]} },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                              }
            ]
          },
          {"matcher":{"id":"byName","options":"TPS"},"properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#3e668f","value":32},{"color":"#f79f64","value":32000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"QPS"},"properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#3e668f","value":32},{"color":"#f79f64","value":32000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {
            "matcher":{"id":"byName","options":"DB Conn"},
            "properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":4},{"color":"#EAB839","value":20},{"color":"#EF843C","value":40},{"color":"#E24D42","value":80},{"color":"#b783af","value":100},{"color":"text","value":400}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]
          },{
            "matcher":{"id":"byName","options":"RT"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                  },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                                 },
              { "id":"mappings"          ,"value":[{"options":{"match":"nan","result":{"index":1,"text":"-"}},"type":"special"}]                                                                                                                      },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#fcdb72","value":1},{"color":"#f79f64","value":2},{"color":"red","value":4},{"color":"#b783af","value":8},{"color":"text","value":16}]} },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                               }
            ]
          },
          {"matcher":{"id":"byName","options":"LB Conn"},"properties":[{"id":"custom.width","value":72},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1},{"color":"#fcdb72","value":1000},{"color":"#f79f64","value":2000},{"color":"red","value":3000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"Queue"},"properties":[{"id":"custom.width","value":60},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"red","value":1}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"HAProxy"},"properties":[{"id":"links","value":[{"targetBlank":true,"title":"HAProxy Admin Page : ${__data.fields.Instance}","url":"/haproxy/${__data.fields.Instance}"}]}]},
          {"matcher":{"id":"byName","options":"Up"},"properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"0":{"color":"#cc4637d9","index":0,"text":"Dead"},"1":{"color":"#346f36cc","index":1,"text":"Alive"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"type":"color-background"}}]}
        ]
      },
      "gridPos":{"h":6,"w":8,"x":16,"y":1},
      "id":175,
      "links":[{"title":"PGSQL Instance : ${primary}","url":"/d/pgsql-instance?var-ins=${primary}&${__url_time_range}"}],
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":false,"displayName":"Instance"}]},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins,ip) (up{job=\"pgsql\", cls=\"$cls\"})"         ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins) (pg_in_recovery{job=\"pgsql\", cls=\"$cls\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"B" }
      ],
      "title":"",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"ins"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{
              "Time":true,
              "Time 1":true,
              "Time 10":true,
              "Time 2":true,
              "Time 3":true,
              "Time 4":true,
              "Time 6":true,
              "Time 8":true,
              "Time 9":true,
              "Value #A":false,
              "Value #B":false,
              "Value #H":false,
              "__name__":true,
              "__name__ 1":true,
              "__name__ 2":true,
              "__name__ 3":true,
              "__name__ 5":true,
              "__name__ 7":true,
              "cls":true,
              "cls 1":true,
              "cls 2":true,
              "cls 3":true,
              "cls 4":true,
              "cls 5":true,
              "cls 6":true,
              "cls 7":true,
              "instance":false,
              "instance 1":true,
              "instance 2":false,
              "instance 3":true,
              "instance 4":true,
              "instance 5":true,
              "instance 6":true,
              "ip 2":true,
              "ip 3":true,
              "ip 4":true,
              "ip 5":true,
              "ip 6":true,
              "ip 7":true,
              "job":true,
              "job 1":true,
              "job 2":true,
              "job 3":true,
              "job 4":true,
              "job 5":true,
              "job 6":true,
              "job 7":true
            },
            "indexByName":{"Time 1":4,"Time 2":5,"Value #A":0,"Value #B":1,"ins":2,"ip":3},
            "renameByName":{"Time 4":"","Value":"Up","Value #A":"Up","Value #B":"Role","Value #C":"TPS","Value #D":"Role","Value #E":"DB Conn","Value #F":"RT","Value #G":"LB Conn","Value #H":"LB","Value #I":"QPS","Value #J":"LB Clients","Value #K":"Lag","cls 1":"","cls 2":"","ins":"Instance","instance":"HAProxy","instance 2":"","ip":"IP","ip 1":"IP"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[{"options":{"/.*PostgreSQL.*/":{"color":"red","index":0,"text":"sdfsd"}},"type":"value"}],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
      "gridPos":{"h":1,"w":24,"x":0,"y":7},
      "id":53,
      "options":{"colorMode":"value","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/^version$/","values":false},"showPercentChange":false,"text":{"valueSize":16},"textMode":"value","wideLayout":true},
      "pluginVersion":"12.0.0",
      "targets":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "editorMode":"code",
          "format":"table",
          "group":[],
          "metricColumn":"none",
          "rawQuery":true,
          "rawSql":"SELECT version();",
          "refId":"A",
          "select":[[{"params":["value"],"type":"column"}]],
          "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
          "timeColumn":"time",
          "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
        }
      ],
      "title":"",
      "transformations":[
        {
          "id":"organize",
          "options":{
            "excludeByName":{"current_setting":false,"indexes":true,"maxconn":false,"relations":true,"schemas":true,"sequences":true,"session":false,"views":true},
            "indexByName":{"databases":0,"maxconn":3,"roles":1,"session":4,"tablespaces":2},
            "renameByName":{
              "current_setting":"fsd",
              "databases":"Databases",
              "foreign_tables":"Foreign Tables",
              "indexes":"Indexes",
              "materialized_views":"Materialized Views",
              "maxconn":"MaxConn",
              "partitioned_indexes":"Partitioned Indexes",
              "partitioned_tables":"Partitioned Tables",
              "relations":"Relations",
              "roles":"Roles",
              "schemas":"Scheamas",
              "sequences":"Sequences",
              "session":"Processes",
              "tablespaces":"Tablespaces",
              "views":"Views"
            }
          }
        }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"postgres","uid":"${dsn}"},
      "description":"Databases of this instance\nTmpl: is this database a template?\nConn: is this database connectable?",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
        "overrides":[
          {
            "matcher":{"id":"byName","options":"Database"},
            "properties":[
              { "id":"links"   ,"value":[]                                                                                                                                                                     },{ "id":"mappings","value":[{"options":{"postgres":{"color":"super-light-orange","index":2},"template0":{"color":"#808080","index":0},"template1":{"color":"#afafaf","index":1}},"type":"value"}] },
              { "id":"color"   ,"value":{"fixedColor":"text","mode":"palette-classic"}                                                                                                                         },{ "id":"links"   ,"value":[{"title":"PGCAT Overview for ${ins}.${__data.fields.Database}","url":"/d/pgcat-database?var-dsn=${ins}.${__data.fields.Database}"}]                                   }
            ]
          },
          {"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"custom.width","value":75},{"id":"unit","value":"decbytes"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"red"},{"color":"#3e668f","value":0},{"color":"#346f36cc","value":1000000000},{"color":"#fcdb72","value":1000000000000},{"color":"#f79f64","value":10000000000000}]}},{"id":"color","value":{"mode":"thresholds"}}]},
          {
            "matcher":{"id":"byName","options":"Age"},
            "properties":[
              { "id":"thresholds"  ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":60000000},{"color":"#EAB839","value":200000000},{"color":"#f79f64","value":600000000},{"color":"red","value":1000000000},{"color":"#b783af","value":2000000000},{"color":"text","value":2137483647}]} },
              { "id":"unit"        ,"value":"short"                                                                                                                                                                                                                                                                            },
              { "id":"custom.width","value":80                                                                                                                                                                                                                                                                                 },
              { "id":"color"       ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                                                              },
              { "id":"decimals"    ,"value":2                                                                                                                                                                                                                                                                                  }
            ]
          },
          {"matcher":{"id":"byName","options":"Session"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":4},{"color":"#EAB839","value":20},{"color":"#f79f64","value":40},{"color":"red","value":80},{"color":"#b783af","value":100},{"color":"text","value":400}]}},{"id":"color","value":{"mode":"thresholds"}},{"id":"custom.width","value":70}]},
          {
            "matcher":{"id":"byName","options":"ConnLimit"},
            "properties":[{"id":"custom.width","value":85},{"id":"color"},{"id":"mappings","value":[{"options":{"-1":{"color":"#3e668f","index":1,"text":"NO LIMIT"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"N/A"}},"type":"special"},{"options":{"from":0,"result":{"color":"#f79f64","index":2},"to":99999999},"type":"range"}]}]
          },
          {"matcher":{"id":"byName","options":"Ctype"},"properties":[{"id":"custom.width","value":110}]},{"matcher":{"id":"byName","options":"Collate"},"properties":[{"id":"custom.width","value":65}]},{"matcher":{"id":"byName","options":"Encoding"},"properties":[{"id":"custom.width","value":90}]},
          {
            "matcher":{"id":"byName","options":"Owner"},
            "properties":[{"id":"custom.align","value":"center"},{"id":"color","value":{"fixedColor":"text","mode":"fixed"}},{"id":"mappings","value":[{"options":{"dbuser_dba":{"color":"light-blue","index":1,"text":"postgres"},"postgres":{"color":"#3e668f","index":0,"text":"postgres"}},"type":"value"},{"options":{"pattern":"(dbuser_.*)","result":{"color":"#346f36cc","index":2,"text":"$1"}},"type":"regex"}]}]
          },
          {"matcher":{"id":"byName","options":"Tablespace"},"properties":[{"id":"custom.width","value":100}]},{"matcher":{"id":"byName","options":"Privileges"},"properties":[{"id":"custom.width","value":150}]},
          {"matcher":{"id":"byName","options":"Tmpl"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#3e668f","index":1,"text":"F"},"true":{"color":"#f79f64","index":0,"text":"T"}},"type":"value"}]},{"id":"custom.width","value":50}]},
          {"matcher":{"id":"byName","options":"Conn"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#f79f64","index":1,"text":"F"},"true":{"color":"#3e668f","index":0,"text":"T"}},"type":"value"}]},{"id":"custom.width","value":55}]},
          {"matcher":{"id":"byName","options":"OID"},"properties":[{"id":"custom.width","value":80},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}
        ]
      },
      "gridPos":{"h":6,"w":24,"x":0,"y":8},
      "id":57,
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"OID"}]},
      "pluginVersion":"12.0.0",
      "targets":[
        {
          "datasource":{"type":"postgres","uid":"da87a3b4-a8de-4e54-b515-40f3e54d18cc"},
          "editorMode":"code",
          "format":"table",
          "group":[],
          "metricColumn":"none",
          "rawQuery":true,
          "rawSql":"SELECT d.datname, d.oid::INTEGER, d.datconnlimit, d.datfrozenxid, age(d.datfrozenxid) AS age, datistemplate,datallowconn,  1 - (datistemplate)::INTEGER + 2 * d.datallowconn::INTEGER AS status, psd.numbackends AS sessions,\n       pg_catalog.pg_get_userbyid(d.datdba) as owner, pg_catalog.pg_encoding_to_char(d.encoding) as encoding,\n       d.datcollate, d.datctype,  pg_catalog.array_to_string(d.datacl, E'\\n') AS acl,\n       CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE -1 END AS size,\n       t.spcname as tablespace,\n       pg_catalog.shobj_description(d.oid, 'pg_database') as description\nFROM pg_catalog.pg_database d JOIN pg_catalog.pg_tablespace t on d.dattablespace = t.oid JOIN pg_stat_database psd on d.oid = psd.datid\nORDER BY 1;",
          "refId":"A",
          "select":[[{"params":["value"],"type":"column"}]],
          "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
          "timeColumn":"time",
          "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
        }
      ],
      "title":"",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"datname"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time 1":true,"Time 10":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"Time 6":true,"Time 7":true,"Time 8":true,"Time 9":true,"acl":false,"datcollate":false,"datctype":false,"datfrozenxid":true,"description":false,"encoding":false,"status":true,"tablespace":false},
            "indexByName":{"acl":14,"age":5,"datallowconn":4,"datcollate":10,"datconnlimit":8,"datctype":11,"datfrozenxid":12,"datistemplate":3,"datname":0,"description":16,"encoding":9,"oid":1,"owner":2,"sessions":7,"size":6,"status":15,"tablespace":13},
            "renameByName":{
              "Time 1":"",
              "Time 7":"",
              "Value #A":"Size",
              "Value #B":"Age",
              "Value #C":"Status",
              "Value #D":"Session",
              "Value #E":"TPS",
              "Value #F":"ConnLimit",
              "Value #G":"Reserve",
              "Value #H":"Current",
              "Value #I":"Disable",
              "Value #J":"Pause",
              "acl":"Privileges",
              "age":"Age",
              "datallowconn":"Conn",
              "datcollate":"Collate",
              "datconnlimit":"ConnLimit",
              "datctype":"Ctype",
              "datfrozenxid":"FronzenXID",
              "datistemplate":"Tmpl",
              "datname":"Database",
              "description":"Description",
              "encoding":"Encoding",
              "host":"Target",
              "oid":"OID",
              "owner":"Owner",
              "real_datname":"Datname",
              "sessions":"Session",
              "size":"Size",
              "status":"Status",
              "tablespace":"Tablespace"
            }
          }
        }
      ],
      "type":"table"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":14},"id":96,"panels":[],"title":"Activity","type":"row"},
    {
      "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
      "fieldConfig":{
        "defaults":{
          "custom":{"align":"center","cellOptions":{"type":"auto"},"filterable":false,"inspect":false},
          "mappings":[],
          "thresholds":{
            "mode":"absolute",
            "steps":[{"color":"#346f36cc"},{"color":"super-light-green","value":0.0001},{"color":"#346f36cc","value":0.01},{"color":"light-yellow","value":0.1},{"color":"#fcdb72","value":1},{"color":"super-light-orange","value":10},{"color":"#f79f64","value":60},{"color":"super-light-red","value":600},{"color":"red","value":1800},{"color":"super-light-purple","value":3600},{"color":"#b783af","value":7200}]
          }
        },
        "overrides":[
          {
            "matcher":{"id":"byName","options":"Database"},
            "properties":[
              { "id":"custom.width"      ,"value":130                                                                                                                                                                                                                                                      },
              { "id":"mappings"          ,"value":[{"options":{"postgres":{"color":"#f79f64","index":0},"template0":{"color":"#808080e0","index":1},"template1":{"color":"#787878e0","index":2}},"type":"value"},{"options":{"match":"null","result":{"color":"transparent","index":3}},"type":"special"}] },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                            },
              { "id":"links"             ,"value":[{"title":"PGCAT Database : ${dsn:text}","url":"/d/pgcat-database?var-dsn=${dsn:text}"}]                                                                                                                                                                 },
              { "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                                                                                                                  },
              { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                                                                     }
            ]
          },{
            "matcher":{"id":"byName","options":"User"},
            "properties":[
              {"id":"custom.width","value":120},
              {
                "id":"mappings",
                "value":[
                  { "options":{"dbuser_dba":{"color":"#cc4637d9","index":1},"dbuser_monitor":{"color":"#f79f64","index":3},"postgres":{"color":"#b783af","index":0},"replicator":{"color":"#fcdb72","index":2}},"type":"value"   },
                  { "options":{"pattern":"dbrole.*","result":{"color":"#3e668f","index":4}}                                                                                                                    ,"type":"regex"   },
                  { "options":{"pattern":"dbuser.*","result":{"color":"#346f36cc","index":5}}                                                                                                                  ,"type":"regex"   },
                  { "options":{"match":"null","result":{"color":"transparent","index":6}}                                                                                                                      ,"type":"special" }
                ]
              },
              {"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.filterable","value":true}
            ]
          },{
            "matcher":{"id":"byName","options":"App"},
            "properties":[
              {"id":"custom.width","value":220},
              {
                "id":"mappings",
                "value":[
                  { "options":{"Patroni":{"color":"#fcdb72","index":0},"Postgres JDBC Driver":{"color":"#b783af","index":2},"pg_exporter":{"color":"#f79f64","index":3},"psql":{"color":"#cc4637d9","index":1}},"type":"value"   },
                  { "options":{"pattern":"pgbench.*","result":{"color":"#5b9cd5","index":4}}                                                                                                                   ,"type":"regex"   },
                  { "options":{"pattern":"(citus|Timescale|Citus).*","result":{"color":"#7771a4","index":5}}                                                                                                   ,"type":"regex"   },
                  { "options":{"match":"null","result":{"color":"transparent","index":6}}                                                                                                                      ,"type":"special" },
                  { "options":{"match":"empty","result":{"color":"transparent","index":7}}                                                                                                                     ,"type":"special" }
                ]
              },
              {"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.filterable","value":true}
            ]
          },{
            "matcher":{"id":"byName","options":"IP"},
            "properties":[
              { "id":"custom.width"      ,"value":120                                                                                                                                                               },{ "id":"mappings"          ,"value":[{"options":{"127.0.0.1":{"color":"#8b8b8b","index":1}},"type":"value"},{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}] },
              { "id":"custom.cellOptions","value":{"type":"auto"}                                                                                                                                                   },{ "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                           },
              { "id":"links"             ,"value":[{"title":"Node Instance : ${__data.fields.IP}","url":"/d/node-instance?var-ip=${__data.fields.IP}&${__url_time_range}"}]                                         },{ "id":"custom.filterable" ,"value":true                                                                                                                                                              }
            ]
          },{
            "matcher":{"id":"byName","options":"Port"},
            "properties":[{"id":"custom.width","value":66},{"id":"mappings","value":[{"options":{"-1":{"color":"#808080e0","index":1,"text":"Socket"}},"type":"value"},{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]
          },{
            "matcher":{"id":"byName","options":"Type"},
            "properties":[
              {"id":"custom.width","value":160},
              {
                "id":"mappings",
                "value":[
                  {
                    "options":{
                      " autovacuum worker"          :{ "color":"#346f36cc","index":12,"text":"Vacuum Worker"    },
                      "archiver"                    :{ "color":"#cc4637d9","index": 5,"text":"Archiver"         },
                      "autovacuum launcher"         :{ "color":"#346f36cc","index":11,"text":"Vacuum Main"      },
                      "background writer"           :{ "color":"#cc4637d9","index": 4,"text":"BGWriter"         },
                      "checkpointer"                :{ "color":"#cc4637d9","index": 3,"text":"Checkpointer"     },
                      "client backend"              :{ "color":"#3e668f"  ,"index": 0,"text":"Client"           },
                      "logical replication launcher":{ "color":"#f79f64"  ,"index": 9,"text":"Logical Launcher" },
                      "logical replication worker"  :{ "color":"#f79f64"  ,"index":10,"text":"Logical Worker"   },
                      "parallel worker"             :{ "color":"#5b9cd5"  ,"index": 1,"text":"Worker"           },
                      "startup"                     :{ "color":"#fcdb72"  ,"index": 8,"text":"Startup"          },
                      "walreceiver"                 :{ "color":"#fcdb72"  ,"index": 7,"text":"WAL Receiver"     },
                      "walsender"                   :{ "color":"#fcdb72"  ,"index": 6,"text":"WAL Sender"       },
                      "walwriter"                   :{ "color":"#cc4637d9","index": 2,"text":"WAL Writer"       }
                    },
                    "type":"value"
                  },
                  {"options":{"pattern":"(Citus|TimescaleDB).*","result":{"color":"#7771a4","index":13}},"type":"regex"}
                ]
              },
              {"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#80808080"}]}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"custom.filterable","value":true}
            ]
          },{
            "matcher":{"id":"byName","options":"State"},
            "properties":[
              {"id":"custom.width","value":150},
              {
                "id":"mappings",
                "value":[
                  { "options":{"active":{"color":"#346f36cc","index":0},"disabled":{"color":"#7f7f7fe0","index":5},"fastpath function call":{"color":"#fcdb72","index":4},"idle":{"color":"#3d668f33","index":1},"idle in transaction":{"color":"#cc4637d9","index":2},"idle in transaction (aborted)":{"color":"#b783af","index":3}},"type":"value"   },
                  { "options":{"match":"null","result":{"color":"transparent","index":6}}                                                                                                                                                                                                                                            ,"type":"special" }
                ]
              },
              {"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"custom.filterable","value":true}
            ]
          },{
            "matcher":{"id":"byName","options":"Wait"},
            "properties":[
              {"id":"custom.width","value":80},
              {
                "id":"mappings",
                "value":[
                  { "options":{"Activity":{"color":"#346f36cc","index":0},"BufferPin":{"color":"#f79f64","index":4},"Client":{"color":"#3e668f","index":1},"Extension":{"color":"#7771a4","index":8},"IO":{"color":"#f7cb67","index":3},"IPC":{"color":"#5b9cd5","index":2},"LWLock":{"color":"#cc4637d9","index":6},"Lock":{"color":"red","index":5},"Timeout":{"color":"#7f7f7f9e","index":7}},"type":"value"   },
                  { "options":{"match":"null","result":{"color":"super-light-green","index":9,"text":"Running"}}                                                                                                                                                                                                                                                                                ,"type":"special" }
                ]
              },
              {"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}
            ]
          },
          {"matcher":{"id":"byName","options":"Event"},"properties":[{"id":"custom.width","value":180},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}}]},
          {"matcher":{"id":"byName","options":"PID"},"properties":[{"id":"custom.width","value":70},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
          {
            "matcher":{"id":"byName","options":"ConnTime"},
            "properties":[
              { "id":"custom.width"      ,"value":100                                                                                                                                                                                           },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                           },
              { "id":"custom.cellOptions","value":{"type":"color-background"}                                                                                                                                                                   },
              { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                    },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":60},{"color":"#fcdb72","value":3600},{"color":"#cc4637d9","value":86400},{"color":"#f79f64","value":183131175}]} }
            ]
          },{
            "matcher":{"id":"byName","options":"XactTime"},
            "properties":[
              { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                 },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                                                 },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                       },
              { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                                          },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1},{"color":"#fcdb72","value":10},{"color":"#f79f64","value":60},{"color":"#cc4637d9","value":600},{"color":"#b783af","value":86400}]} }
            ]
          },{
            "matcher":{"id":"byName","options":"QueryTime"},
            "properties":[
              { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                 },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                                                 },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                               },
              { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                                          },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1},{"color":"#fcdb72","value":10},{"color":"#f79f64","value":60},{"color":"#cc4637d9","value":600},{"color":"#b783af","value":86400}]} }
            ]
          },{
            "matcher":{"id":"byName","options":"StateTime"},
            "properties":[
              { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                 },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                                                 },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                               },
              { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                                          },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1},{"color":"#fcdb72","value":10},{"color":"#f79f64","value":60},{"color":"#cc4637d9","value":600},{"color":"#b783af","value":86400}]} }
            ]
          },
          {"matcher":{"id":"byName","options":"Query"},"properties":[{"id":"custom.width","value":200},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"links","value":[{"title":"${__data.fields.SQL}","url":"/d/pgcat-query?var-dsn=${dsn:text}&var-query=${__data.fields.Query}"}]},{"id":"unit","value":"string"}]},
          {"matcher":{"id":"byName","options":"SQL"},"properties":[{"id":"custom.inspect","value":true},{"id":"custom.minWidth","value":240},{"id":"custom.align","value":"left"}]},{"matcher":{"id":"byName","options":"Start"},"properties":[{"id":"custom.width","value":200},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byRegexp","options":"/XID|XMIN|LeaderPID|UID|DBID/"},"properties":[{"id":"custom.width","value":80},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},{"matcher":{"id":"byRegexp","options":"/^(Type|State|Database|User|App|IP|Wait|Event)$/"},"properties":[{"id":"custom.filterable","value":true}]},
          {"matcher":{"id":"byName","options":"Blocking PIDs"},"properties":[{"id":"mappings","value":[{"options":{"{}":{"color":"transparent","index":0}},"type":"value"}]},{"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#f79f64"}]}},{"id":"custom.width","value":110}]}
        ]
      },
      "gridPos":{"h":15,"w":24,"x":0,"y":15},
      "id":59,
      "links":[{"title":"PGCAT Database : ${dsn:text}","url":"/d/pgcat-database?var-dsn=${dsn:text}&viewPanel=216"}],
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":false,"displayName":"State"}]},
      "pluginVersion":"12.0.0",
      "targets":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "editorMode":"code",
          "format":"table",
          "group":[],
          "metricColumn":"none",
          "rawQuery":true,
          "rawSql":"SELECT pg_blocking_pids(pid) AS blocking_pids,\n       datid,\n       datname,\n       pid,\n       leader_pid,\n       usesysid,\n       usename,\n       application_name,\n       client_addr,\n       client_hostname,\n       client_port,\n       extract(epoch from now() - backend_start) AS conn_time,\n       extract(epoch from now() - xact_start)    AS xact_time,\n       extract(epoch from now() - query_start)   AS query_time,\n       extract(epoch from now() - state_change)  AS state_time,\n       wait_event_type,\n       wait_event,\n       state,\n       backend_xid,\n       backend_xmin,\n       query_id,\n       query,\n       backend_type,\n       query_id::TEXT AS qid -- 14 has query_id, comment this for PG 13 and below \nFROM pg_stat_activity;",
          "refId":"A",
          "select":[[{"params":["value"],"type":"column"}]],
          "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
          "timeColumn":"time",
          "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
        }
      ],
      "title":"Activity",
      "transformations":[
        {
          "id":"organize",
          "options":{
            "excludeByName":{"backend_start":false,"backend_xid":false,"backend_xmin":false,"client_hostname":true,"datid":false,"leader_pid":false,"query_id":true,"query_start":true,"state_change":true,"usesysid":false,"xact_start":true},
            "indexByName":{
              "application_name":6,
              "backend_start":14,
              "backend_type":1,
              "backend_xid":22,
              "backend_xmin":23,
              "blocking_pids":3,
              "client_addr":7,
              "client_hostname":27,
              "client_port":8,
              "conn_time":15,
              "datid":26,
              "datname":4,
              "leader_pid":24,
              "pid":0,
              "qid":9,
              "query":11,
              "query_id":10,
              "query_start":20,
              "query_time":17,
              "state":2,
              "state_change":21,
              "state_time":16,
              "usename":5,
              "usesysid":25,
              "wait_event":13,
              "wait_event_type":12,
              "xact_start":19,
              "xact_time":18
            },
            "renameByName":{
              "application_name":"App",
              "backend_start":"Start",
              "backend_type":"Type",
              "backend_xid":"XID",
              "backend_xmin":"XMIN",
              "blocking_pids":"Blocking PIDs",
              "client_addr":"IP",
              "client_hostname":"ClientHostname",
              "client_port":"Port",
              "conn_time":"ConnTime",
              "datid":"DBID",
              "datname":"Database",
              "leader_pid":"LeaderPID",
              "pid":"PID",
              "qid":"Query",
              "query":"SQL",
              "query_id":"QueryID",
              "query_start":"Query Start",
              "query_time":"QueryTime",
              "state":"State",
              "state_change":"Stage Change",
              "state_time":"StateTime",
              "usename":"User",
              "usesysid":"UID",
              "wait_event":"Event",
              "wait_event_type":"Wait",
              "xact_start":"Xact Start",
              "xact_time":"XactTime"
            }
          }
        }
      ],
      "type":"table"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":30},
      "id":177,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "description":"Block by : Which pid are blocked by this PID ?\n\nBlock N: how many process are blocked by this process?",
          "fieldConfig":{
            "defaults":{
              "custom":{"align":"center","cellOptions":{"type":"auto"},"filterable":false,"inspect":false},
              "mappings":[],
              "thresholds":{
                "mode":"absolute",
                "steps":[{"color":"#346f36cc"},{"color":"super-light-green","value":0.0001},{"color":"#346f36cc","value":0.01},{"color":"light-yellow","value":0.1},{"color":"#fcdb72","value":1},{"color":"super-light-orange","value":10},{"color":"#f79f64","value":60},{"color":"super-light-red","value":600},{"color":"red","value":1800},{"color":"super-light-purple","value":3600},{"color":"#b783af","value":7200}]
              }
            },
            "overrides":[
              {
                "matcher":{"id":"byName","options":"Database"},
                "properties":[
                  { "id":"custom.width"      ,"value":130                                                                                                                                                                                                                                                      },
                  { "id":"mappings"          ,"value":[{"options":{"postgres":{"color":"#f79f64","index":0},"template0":{"color":"#808080e0","index":1},"template1":{"color":"#787878e0","index":2}},"type":"value"},{"options":{"match":"null","result":{"color":"transparent","index":3}},"type":"special"}] },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                            },
                  { "id":"links"             ,"value":[{"title":"PGCAT Database : ${dsn:text}","url":"/d/pgcat-database?var-dsn=${dsn:text}"}]                                                                                                                                                                 },
                  { "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                                                                                                                  },
                  { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                                                                     }
                ]
              },{
                "matcher":{"id":"byName","options":"User"},
                "properties":[
                  {"id":"custom.width","value":120},
                  {
                    "id":"mappings",
                    "value":[
                      { "options":{"dbuser_dba":{"color":"#cc4637d9","index":1},"dbuser_monitor":{"color":"#f79f64","index":3},"postgres":{"color":"#b783af","index":0},"replicator":{"color":"#fcdb72","index":2}},"type":"value"   },
                      { "options":{"pattern":"dbrole.*","result":{"color":"#3e668f","index":4}}                                                                                                                    ,"type":"regex"   },
                      { "options":{"pattern":"dbuser.*","result":{"color":"#346f36cc","index":5}}                                                                                                                  ,"type":"regex"   },
                      { "options":{"match":"null","result":{"color":"transparent","index":6}}                                                                                                                      ,"type":"special" }
                    ]
                  },
                  {"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.filterable","value":true}
                ]
              },{
                "matcher":{"id":"byName","options":"App"},
                "properties":[
                  {"id":"custom.width","value":220},
                  {
                    "id":"mappings",
                    "value":[
                      { "options":{"Patroni":{"color":"#fcdb72","index":0},"Postgres JDBC Driver":{"color":"#b783af","index":2},"pg_exporter":{"color":"#f79f64","index":3},"psql":{"color":"#cc4637d9","index":1}},"type":"value"   },
                      { "options":{"pattern":"pgbench.*","result":{"color":"#5b9cd5","index":4}}                                                                                                                   ,"type":"regex"   },
                      { "options":{"pattern":"(citus|Timescale|Citus).*","result":{"color":"#7771a4","index":5}}                                                                                                   ,"type":"regex"   },
                      { "options":{"match":"null","result":{"color":"transparent","index":6}}                                                                                                                      ,"type":"special" },
                      { "options":{"match":"empty","result":{"color":"transparent","index":7}}                                                                                                                     ,"type":"special" }
                    ]
                  },
                  {"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.filterable","value":true}
                ]
              },{
                "matcher":{"id":"byName","options":"IP"},
                "properties":[
                  { "id":"custom.width"      ,"value":120                                                                                                                                                               },{ "id":"mappings"          ,"value":[{"options":{"127.0.0.1":{"color":"#8b8b8b","index":1}},"type":"value"},{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}] },
                  { "id":"custom.cellOptions","value":{"type":"auto"}                                                                                                                                                   },{ "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                           },
                  { "id":"links"             ,"value":[{"title":"Node Instance : ${__data.fields.IP}","url":"/d/node-instance?var-ip=${__data.fields.IP}&${__url_time_range}"}]                                         },{ "id":"custom.filterable" ,"value":true                                                                                                                                                              }
                ]
              },{
                "matcher":{"id":"byName","options":"Port"},
                "properties":[{"id":"custom.width","value":66},{"id":"mappings","value":[{"options":{"-1":{"color":"#808080e0","index":1,"text":"Socket"}},"type":"value"},{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]
              },{
                "matcher":{"id":"byName","options":"Type"},
                "properties":[
                  {"id":"custom.width","value":160},
                  {
                    "id":"mappings",
                    "value":[
                      {
                        "options":{
                          " autovacuum worker"          :{ "color":"#346f36cc","index":12,"text":"Vacuum Worker"    },
                          "archiver"                    :{ "color":"#cc4637d9","index": 5,"text":"Archiver"         },
                          "autovacuum launcher"         :{ "color":"#346f36cc","index":11,"text":"Vacuum Main"      },
                          "background writer"           :{ "color":"#cc4637d9","index": 4,"text":"BGWriter"         },
                          "checkpointer"                :{ "color":"#cc4637d9","index": 3,"text":"Checkpointer"     },
                          "client backend"              :{ "color":"#3e668f"  ,"index": 0,"text":"Client"           },
                          "logical replication launcher":{ "color":"#f79f64"  ,"index": 9,"text":"Logical Launcher" },
                          "logical replication worker"  :{ "color":"#f79f64"  ,"index":10,"text":"Logical Worker"   },
                          "parallel worker"             :{ "color":"#5b9cd5"  ,"index": 1,"text":"Worker"           },
                          "startup"                     :{ "color":"#fcdb72"  ,"index": 8,"text":"Startup"          },
                          "walreceiver"                 :{ "color":"#fcdb72"  ,"index": 7,"text":"WAL Receiver"     },
                          "walsender"                   :{ "color":"#fcdb72"  ,"index": 6,"text":"WAL Sender"       },
                          "walwriter"                   :{ "color":"#cc4637d9","index": 2,"text":"WAL Writer"       }
                        },
                        "type":"value"
                      },
                      {"options":{"pattern":"(Citus|TimescaleDB).*","result":{"color":"#7771a4","index":13}},"type":"regex"}
                    ]
                  },
                  {"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#80808080"}]}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"custom.filterable","value":true}
                ]
              },{
                "matcher":{"id":"byName","options":"State"},
                "properties":[
                  {"id":"custom.width","value":150},
                  {
                    "id":"mappings",
                    "value":[
                      { "options":{"active":{"color":"#346f36cc","index":0},"disabled":{"color":"#7f7f7fe0","index":6},"fastpath function call":{"color":"#fcdb72","index":5},"idle":{"color":"#3d668f33","index":1},"idle in transaction":{"color":"#cc4637d9","index":3},"idle in transaction (aborted)":{"color":"#b783af","index":4},"waiting":{"color":"#f79f64","index":2}},"type":"value"   },
                      { "options":{"match":"null","result":{"color":"transparent","index":7}}                                                                                                                                                                                                                                                                                    ,"type":"special" }
                    ]
                  },
                  {"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"custom.filterable","value":true}
                ]
              },{
                "matcher":{"id":"byName","options":"Wait"},
                "properties":[
                  {"id":"custom.width","value":80},
                  {
                    "id":"mappings",
                    "value":[
                      { "options":{"Activity":{"color":"#346f36cc","index":0},"BufferPin":{"color":"#f79f64","index":4},"Client":{"color":"#3e668f","index":1},"Extension":{"color":"#7771a4","index":8},"IO":{"color":"#f7cb67","index":3},"IPC":{"color":"#5b9cd5","index":2},"LWLock":{"color":"#cc4637d9","index":6},"Lock":{"color":"red","index":5},"Timeout":{"color":"#7f7f7f9e","index":7}},"type":"value"   },
                      { "options":{"match":"null","result":{"color":"super-light-green","index":9,"text":"Running"}}                                                                                                                                                                                                                                                                                ,"type":"special" }
                    ]
                  },
                  {"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}
                ]
              },
              {"matcher":{"id":"byName","options":"Event"},"properties":[{"id":"custom.width","value":180},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}}]},
              {"matcher":{"id":"byName","options":"PID"},"properties":[{"id":"custom.width","value":70},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
              {
                "matcher":{"id":"byName","options":"ConnTime"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                           },
                  { "id":"unit"              ,"value":"s"                                                                                                                                                                                           },
                  { "id":"custom.cellOptions","value":{"type":"color-background"}                                                                                                                                                                   },
                  { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                    },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":60},{"color":"#fcdb72","value":3600},{"color":"#cc4637d9","value":86400},{"color":"#f79f64","value":183131175}]} }
                ]
              },{
                "matcher":{"id":"byName","options":"Xact Wait"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                               },
                  { "id":"unit"              ,"value":"s"                                                                                                                                                                                                                                               },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                     },
                  { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                                                                        },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":0.001},{"color":"#fcdb72","value":0.01},{"color":"#f79f64","value":0.1},{"color":"#cc4637d9","value":1},{"color":"#b783af","value":10},{"color":"text","value":60}]} },
                  { "id":"color"                                                                                                                                                                                                                                                                        }
                ]
              },{
                "matcher":{"id":"byName","options":"Lock Wait"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                               },
                  { "id":"unit"              ,"value":"s"                                                                                                                                                                                                                                               },
                  { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                             },
                  { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                                                                        },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":0.001},{"color":"#fcdb72","value":0.01},{"color":"#f79f64","value":0.1},{"color":"#cc4637d9","value":1},{"color":"#b783af","value":10},{"color":"text","value":60}]} },
                  { "id":"custom.cellOptions","value":{"type":"color-background"}                                                                                                                                                                                                                       }
                ]
              },{
                "matcher":{"id":"byName","options":"StateTime"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                 },
                  { "id":"unit"              ,"value":"s"                                                                                                                                                                                                                 },
                  { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                               },
                  { "id":"mappings"          ,"value":[{"options":{"match":"null","result":{"color":"transparent","index":0}},"type":"special"}]                                                                                                                          },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1},{"color":"#fcdb72","value":10},{"color":"#f79f64","value":60},{"color":"#cc4637d9","value":600},{"color":"#b783af","value":86400}]} }
                ]
              },
              {"matcher":{"id":"byName","options":"Query"},"properties":[{"id":"custom.width","value":200},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"links","value":[{"title":"${__data.fields.SQL}","url":"/d/pgcat-query?var-dsn=${dsn:text}&var-query=${__data.fields.Query}"}]},{"id":"unit","value":"string"}]},
              {"matcher":{"id":"byName","options":"SQL"},"properties":[{"id":"custom.inspect","value":true},{"id":"custom.minWidth","value":500},{"id":"custom.align","value":"left"}]},{"matcher":{"id":"byName","options":"Start"},"properties":[{"id":"custom.width","value":200},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
              {"matcher":{"id":"byRegexp","options":"/XID|XMIN|LeaderPID|UID|DBID/"},"properties":[{"id":"custom.width","value":80},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},{"matcher":{"id":"byRegexp","options":"/^(Type|State|Database|User|App|IP|Wait|Event)$/"},"properties":[{"id":"custom.filterable","value":true}]},
              {"matcher":{"id":"byName","options":"Block By"},"properties":[{"id":"mappings","value":[{"options":{"{}":{"color":"#346f36cc","index":0}},"type":"value"}]},{"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#f79f64"}]}},{"id":"custom.width","value":110}]},
              {"matcher":{"id":"byName","options":"Level"},"properties":[{"id":"custom.width","value":60},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#f79f64","value":1},{"color":"#cc4637d9","value":2},{"color":"#b783af","value":3},{"color":"#7771a4","value":4},{"color":"text","value":5}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"Block N"},"properties":[{"id":"custom.width","value":70},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#f79f64","value":1},{"color":"#cc4637d9","value":2}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},{"matcher":{"id":"byName","options":"XMin"},"properties":[{"id":"custom.width","value":110}]},
              {
                "matcher":{"id":"byName","options":"XID Age"},
                "properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":8},{"color":"#f79f64","value":32},{"color":"#EAB839","value":32},{"color":"#cc4637d9","value":128},{"color":"#7771a4","value":1000000000},{"color":"text","value":2000000000}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"color"}]
              }
            ]
          },
          "gridPos":{"h":11,"w":24,"x":0,"y":72},
          "id":179,
          "links":[{"title":"PGCAT Database : ${dsn:text}","url":"/d/pgcat-database?var-dsn=${dsn:text}&viewPanel=220"}],
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"postgres","uid":"${dsn}"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"WITH RECURSIVE\n    activity as (select pg_blocking_pids(pid) blocked_by, *,\n                        extract(seconds FROM age(clock_timestamp(), xact_start)) as xact_wait,\n                        extract(seconds FROM age(clock_timestamp(),\n                            -- (select max(l.waitstart) from pg_locks l where a.pid = l.pid)    -- PG 14 and newer\n                             state_change       -- PG 13 and below\n                            )) as lock_wait\n                 -- \"pg_locks.waitstart\" \u2013 PG14+ only; for older versions:  age(clock_timestamp(), state_change) as wait_age\n                 from pg_stat_activity a\n                 where state is distinct from 'idle'),\n    blockers as (select array_agg(distinct c order by c) as pids\n                 from (select unnest(blocked_by)\n                       from activity) as dt(c)),\n    tree as (select activity.*,\n                    1                           as level,\n                    activity.pid                as top_blocker_pid,\n                    array [activity.pid]        as path,\n                    array [activity.pid]::int[] as all_blockers_above\n             from activity, blockers\n             where array [pid] <@ blockers.pids and blocked_by = '{}'::int[]\n             union all\n             select activity.*,\n                    tree.level + 1 as level,\n                    tree.top_blocker_pid,\n                    path || array [activity.pid] as path,\n                    tree.all_blockers_above || array_agg(activity.pid) over () as all_blockers_above\n             from activity,\n                  tree\n             where not array [activity.pid] <@ tree.all_blockers_above\n               and activity.blocked_by <> '{}'::int[]\n               and activity.blocked_by <@ tree.all_blockers_above)\nselect pid,\n       blocked_by,\n       case when wait_event_type = 'Lock' then 'waiting' else state end                                      as state,\n       wait_event_type,\n       wait_event,\n       xact_wait,\n       lock_wait,\n       age(backend_xid) AS xid_age,\n       -- 2147483647 - age(backend_xmin) as xmin_ttf,\n       datname, usename, level - 1 AS level,\n       (select count(distinct t1.pid) from tree t1 where array [tree.pid] <@ t1.path and t1.pid <> tree.pid) as blkd,\n       format('%s %s%s', lpad('[' || pid::text || ']', 9, ' '), repeat('.', level - 1) || case when level > 1 then ' ' end, left(query, 1000) ) as query\nfrom tree\nWHERE datname = CURRENT_DATABASE()\norder by top_blocker_pid, level, pid;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Locks for ${dsn:text}",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{"backend_start":false,"backend_xid":false,"backend_xmin":false,"client_hostname":true,"datid":false,"leader_pid":false,"query_id":true,"query_start":true,"state_change":true,"usesysid":false,"xact_start":true},
                "indexByName":{"blkd":5,"blocked_by":4,"datname":0,"level":8,"lock_wait":9,"pid":3,"query":10,"state":2,"usename":1,"wait_event":7,"wait_event_type":6,"xact_wait":11,"xid_age":12,"xmin_ttf":13},
                "renameByName":{
                  "application_name":"App",
                  "backend_start":"Start",
                  "backend_type":"Type",
                  "backend_xid":"XID",
                  "backend_xmin":"XMIN",
                  "blkd":"Block N",
                  "blocked_by":"Block By",
                  "blocking_pids":"Blocking PIDs",
                  "client_addr":"IP",
                  "client_hostname":"ClientHostname",
                  "client_port":"Port",
                  "conn_time":"ConnTime",
                  "datid":"DBID",
                  "datname":"Database",
                  "leader_pid":"LeaderPID",
                  "level":"Level",
                  "lock_wait":"Lock Wait",
                  "pid":"PID",
                  "qid":"Query",
                  "query":"SQL",
                  "query_id":"QueryID",
                  "query_start":"Query Start",
                  "query_time":"QueryTime",
                  "state":"State",
                  "state_change":"Stage Change",
                  "state_time":"StateTime",
                  "usename":"User",
                  "usesysid":"UID",
                  "wait_event":"Event",
                  "wait_event_type":"Wait",
                  "xact_start":"Xact Start",
                  "xact_time":"XactTime",
                  "xact_wait":"Xact Wait",
                  "xid_age":"XID Age",
                  "xmin_ttf":"XMin"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Locks",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":31},
      "id":153,
      "panels":[
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Session group by pg_stat_activity.backend_type\n\nSystem Processes Included",
          "fieldConfig":{
            "defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[]},
            "overrides":[
              { "matcher":{"id":"byName","options":"idle"}                                  ,"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]           },{ "matcher":{"id":"byName","options":"null"}                                  ,"properties":[{"id":"color","value":{"fixedColor":"#80808080","mode":"fixed"}}]         },
              { "matcher":{"id":"byName","options":"active"}                                ,"properties":[{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}]         },{ "matcher":{"id":"byName","options":"client backend"}                        ,"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]           },
              { "matcher":{"id":"byName","options":"checkpointer"}                          ,"properties":[{"id":"color","value":{"fixedColor":"light-red","mode":"fixed"}}]         },{ "matcher":{"id":"byName","options":"background writer"}                     ,"properties":[{"id":"color","value":{"fixedColor":"super-light-green","mode":"fixed"}}] },
              { "matcher":{"id":"byName","options":"walsender"}                             ,"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]           },{ "matcher":{"id":"byName","options":"TimescaleDB Background Worker Launcher"},"properties":[{"id":"color","value":{"fixedColor":"#808080","mode":"fixed"}}]           },
              { "matcher":{"id":"byName","options":"archiver"}                              ,"properties":[{"id":"color","value":{"fixedColor":"super-light-red","mode":"fixed"}}]   },{ "matcher":{"id":"byName","options":"autovacuum launcher"}                   ,"properties":[{"id":"color","value":{"fixedColor":"dark-yellow","mode":"fixed"}}]       },
              { "matcher":{"id":"byName","options":"walwriter"}                             ,"properties":[{"id":"color","value":{"fixedColor":"dark-red","mode":"fixed"}}]          },{ "matcher":{"id":"byName","options":"logical replication launcher"}          ,"properties":[{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]           }
            ]
          },
          "gridPos":{"h":8,"w":8,"x":0,"y":123},
          "id":105,
          "options":{"displayLabels":[],"legend":{"displayMode":"table","placement":"right","showLegend":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT\n  extract(epoch from now()) AS time,\n  coalesce(backend_type, 'null') as metric,\n  count(*) as value\nFROM pg_stat_activity\nGROUP BY coalesce(backend_type, 'null');",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Sessions (by Type)",
          "type":"piechart"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Session group by pg_stat_activity.state\n\nSystem Processes Included",
          "fieldConfig":{
            "defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[]},
            "overrides":[
              { "matcher":{"id":"byName","options":"_system"}            ,"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]   },{ "matcher":{"id":"byName","options":"null"}               ,"properties":[{"id":"color","value":{"fixedColor":"#80808080","mode":"fixed"}}] },
              { "matcher":{"id":"byName","options":"active"}             ,"properties":[{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },{ "matcher":{"id":"byName","options":"idle"}               ,"properties":[{"id":"color","value":{"fixedColor":"#3d668f33","mode":"fixed"}}] },
              { "matcher":{"id":"byName","options":"idle in transaction"},"properties":[{"id":"color","value":{"fixedColor":"#cc4637d9","mode":"fixed"}}] }
            ]
          },
          "gridPos":{"h":8,"w":8,"x":8,"y":123},
          "id":104,
          "options":{"displayLabels":[],"legend":{"displayMode":"table","placement":"right","showLegend":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT\n  extract(epoch from now()) AS time,\n  coalesce(state, '_system') AS metric,\n  count(*) AS value\nFROM pg_stat_activity\n-- WHERE state IS NOT NULL\nGROUP BY 2;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Sessions (by State)",
          "type":"piechart"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Session group by pg_stat_activity.wait_event_type\n\nSystem Processes Included",
          "fieldConfig":{"defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[]},"overrides":[{"matcher":{"id":"byName","options":"null"},"properties":[{"id":"color","value":{"fixedColor":"#80808080","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"ClientRead"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]},
          "gridPos":{"h":8,"w":8,"x":16,"y":123},
          "id":103,
          "options":{"displayLabels":[],"legend":{"displayMode":"table","placement":"right","showLegend":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT\n  extract(epoch from now()) AS time,\n  coalesce(wait_event, 'Running') as metric,\n  count(*) as value\nFROM pg_stat_activity\nGROUP BY 2;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Sessions (by Wait Event)",
          "type":"piechart"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Session group by pg_stat_activity.client_addr/client_port\n\nSystem Processes Excluded",
          "fieldConfig":{"defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[]},"overrides":[{"matcher":{"id":"byName","options":"_system"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"unix socket"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]},
          "gridPos":{"h":8,"w":8,"x":0,"y":131},
          "id":107,
          "options":{"displayLabels":[],"legend":{"displayMode":"table","placement":"right","showLegend":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT now() AS time, metric AS metric, value FROM\n(SELECT coalesce(host(client_addr),'') || CASE client_port WHEN -1 THEN 'unix socket' ELSE ':' || client_port::TEXT END AS metric, count(*) AS value \nFROM pg_stat_activity WHERE state IS NOT NULL GROUP BY 1);",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Sessions (by Client Addr)",
          "type":"piechart"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Session group by pg_stat_activity.usename\n\nSystem Processes Excluded",
          "fieldConfig":{
            "defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[]},
            "overrides":[
              { "matcher":{"id":"byName","options":"idle"}             ,"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]          },{ "matcher":{"id":"byName","options":"null"}             ,"properties":[{"id":"color","value":{"fixedColor":"#80808080","mode":"fixed"}}]        },
              { "matcher":{"id":"byName","options":"active"}           ,"properties":[{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}]        },{ "matcher":{"id":"byName","options":"client backend"}   ,"properties":[{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}]        },
              { "matcher":{"id":"byName","options":"checkpointer"}     ,"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]          },{ "matcher":{"id":"byName","options":"background writer"},"properties":[{"id":"color","value":{"fixedColor":"super-light-blue","mode":"fixed"}}] },
              { "matcher":{"id":"byName","options":"postgres"}         ,"properties":[{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]          },{ "matcher":{"id":"byName","options":"dbuser_monitor"}   ,"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]          },
              { "matcher":{"id":"byName","options":"_system"}          ,"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]          }
            ]
          },
          "gridPos":{"h":8,"w":8,"x":8,"y":131},
          "id":109,
          "options":{"displayLabels":[],"legend":{"displayMode":"table","placement":"right","showLegend":true,"sortBy":"Value","sortDesc":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT\n  extract(epoch from now()) AS time,\n  coalesce(usename, '_system') as metric,\n  count(*) as value\nFROM pg_stat_activity\nWHERE state IS NOT NULL\nGROUP BY 2;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Sessions (by User)",
          "type":"piechart"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Session group by pg_stat_activity.application_name\n\nSystem Processes Excluded",
          "fieldConfig":{"defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[{"options":{"match":"empty","result":{"index":1,"text":"unknown"}},"type":"special"}]},"overrides":[{"matcher":{"id":"byName","options":"unknown"},"properties":[{"id":"color","value":{"fixedColor":"#3d668f54","mode":"fixed"}}]}]},
          "gridPos":{"h":8,"w":8,"x":16,"y":131},
          "id":106,
          "options":{"displayLabels":[],"legend":{"displayMode":"table","placement":"right","showLegend":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT\n  extract(epoch from now()) AS time,\n  CASE application_name WHEN '' THEN  'unknown' ELSE application_name END as metric,\n  count(*) as value\nFROM pg_stat_activity\nWHERE state IS NOT NULL\nGROUP BY 2;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Sessions (by App)",
          "type":"piechart"
        }
      ],
      "title":"Session",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":32},
      "id":133,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "description":"pg_stat_statements of instance ${ins}, order by total_exec_time DESC.",
          "fieldConfig":{
            "defaults":{"custom":{"align":"center","cellOptions":{"type":"auto"},"filterable":false,"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
            "overrides":[
              {
                "matcher":{"id":"byRegexp","options":"(RT:avg)"},
                "properties":[
                  { "id":"unit"              ,"value":"ms"                                                                                                                                                                                                                                                                                                                                 },
                  { "id":"custom.width"      ,"value":80                                                                                                                                                                                                                                                                                                                                   },
                  { "id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}                                                                                                                                                                                                                                                                                           },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"super-light-blue"},{"color":"#3e668f","value":0.1},{"color":"light-green","value":1},{"color":"#346f36cc","value":2},{"color":"#fcdb72","value":10},{"color":"#f79f64","value":100},{"color":"red","value":1000},{"color":"#b783af","value":60000},{"color":"rgb(80, 6, 94)","value":600000}]} },
                  { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                                                                                                                    }
                ]
              },
              {"matcher":{"id":"byName","options":"Query"},"properties":[{"id":"custom.width","value":200},{"id":"unit","value":"string"},{"id":"links","value":[{"title":"${__data.fields.SQL}","url":"/d/pgcat-query?var-dsn=${dsn:text}&var-query=${__data.fields.Query}"}]},{"id":"custom.cellOptions","value":{"type":"auto"}}]},
              {"matcher":{"id":"byName","options":"Database"},"properties":[{"id":"custom.width","value":110},{"id":"links","value":[{"title":"PGCAT Database for ${__data.fields.Database}","url":"/d/pgcat-database?var-dsn=${ins}.${__data.fields.Database}"}]},{"id":"custom.filterable","value":true}]},
              {"matcher":{"id":"byName","options":"User"},"properties":[{"id":"custom.width","value":120},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"custom.align","value":"left"},{"id":"custom.filterable","value":true}]},
              {"matcher":{"id":"byName","options":"SQL"},"properties":[{"id":"unit","value":"string"},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"custom.minWidth","value":256},{"id":"custom.inspect","value":true},{"id":"custom.align","value":"left"}]},
              {"matcher":{"id":"byName","options":"Calls"},"properties":[{"id":"custom.width","value":120},{"id":"unit","value":"locale"},{"id":"custom.cellOptions","value":{"type":"auto"}}]},{"matcher":{"id":"byName","options":"Rows"},"properties":[{"id":"custom.width","value":100},{"id":"unit","value":"short"},{"id":"custom.cellOptions","value":{"type":"auto"}}]},
              {"matcher":{"id":"byName","options":"Time"},"properties":[{"id":"custom.width","value":100},{"id":"unit","value":"ms"},{"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"}]}}]},
              {"matcher":{"id":"byName","options":"Top"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#f79f64","index":0,"text":"F"},"true":{"color":"#346f36cc","index":1,"text":"T"}},"type":"value"}]},{"id":"custom.width","value":60},{"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"custom.filterable","value":true}]},
              {"matcher":{"id":"byRegexp","options":"/Plan:.*|RT:.*|.*Time/"},"properties":[{"id":"unit","value":"ms"},{"id":"custom.width","value":100}]},
              {"matcher":{"id":"byRegexp","options":"/.*Blks.*/"},"properties":[{"id":"unit","value":"locale"},{"id":"custom.width","value":100},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#7a7a7a40","value":1}]}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"Plan"},"properties":[{"id":"custom.width","value":40},{"id":"unit","value":"short"}]},
              {"matcher":{"id":"byRegexp","options":"/WAL.*/"},"properties":[{"id":"custom.width","value":100},{"id":"unit","value":"short"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#7d7d7d33","value":1}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
              {"matcher":{"id":"byRegexp","options":"/JIT.*Count/"},"properties":[{"id":"custom.width","value":150},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#7d7d7d33","value":1}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
              {"matcher":{"id":"byRegexp","options":"/JIT.*Time/"},"properties":[{"id":"custom.width","value":150},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#7d7d7d33","value":1e-09}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"JIT Functions"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#7d7d7d33","value":1}]}},{"id":"custom.cellOptions","value":{"type":"color-background"}}]},
              {"matcher":{"id":"byRegexp","options":"/.*Blk.*Time/"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#7d7d7d33","value":1e-07}]}}]}
            ]
          },
          "gridPos":{"h":18,"w":24,"x":0,"y":140},
          "id":172,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"Time"}]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"postgres","uid":"${dsn}"},
              "editorMode":"code",
              "expr":"",
              "format":"table",
              "group":[],
              "legendFormat":"__auto",
              "metricColumn":"none",
              "range":true,
              "rawQuery":true,
              "rawSql":"SELECT queryid::TEXT AS qid, d.datname, r.rolname, s.*\nFROM pg_stat_statements s\n         LEFT JOIN pg_database d ON s.dbid = d.oid\n         LEFT JOIN pg_roles r ON s.userid = r.oid\nORDER BY total_exec_time DESC\nLIMIT 100;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Top SQL by Time",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{
                  "blk_read_time":false,
                  "blk_write_time":false,
                  "datname":false,
                  "dbid":true,
                  "local_blks_dirtied":false,
                  "local_blks_hit":false,
                  "local_blks_read":false,
                  "local_blks_written":false,
                  "max_plan_time":false,
                  "mean_plan_time":false,
                  "min_plan_time":false,
                  "plans":false,
                  "queryid":true,
                  "shared_blks_dirtied":false,
                  "shared_blks_hit":false,
                  "shared_blks_read":false,
                  "shared_blks_written":false,
                  "stddev_exec_time":false,
                  "stddev_plan_time":false,
                  "temp_blk_read_time":false,
                  "temp_blk_write_time":false,
                  "temp_blks_read":false,
                  "temp_blks_written":false,
                  "total_plan_time":false,
                  "userid":true
                },
                "indexByName":{
                  "blk_read_time":34,
                  "blk_write_time":35,
                  "calls":8,
                  "datname":1,
                  "dbid":6,
                  "jit_emission_count":44,
                  "jit_emission_time":45,
                  "jit_functions":38,
                  "jit_generation_time":39,
                  "jit_inlining_count":40,
                  "jit_inlining_time":41,
                  "jit_optimization_count":42,
                  "jit_optimization_time":43,
                  "local_blks_dirtied":30,
                  "local_blks_hit":28,
                  "local_blks_read":29,
                  "local_blks_written":31,
                  "max_exec_time":13,
                  "max_plan_time":20,
                  "mean_exec_time":12,
                  "mean_plan_time":18,
                  "min_exec_time":14,
                  "min_plan_time":19,
                  "plans":16,
                  "qid":2,
                  "query":3,
                  "queryid":7,
                  "rolname":4,
                  "rows":9,
                  "shared_blks_dirtied":26,
                  "shared_blks_hit":24,
                  "shared_blks_read":25,
                  "shared_blks_written":27,
                  "stddev_exec_time":15,
                  "stddev_plan_time":21,
                  "temp_blk_read_time":36,
                  "temp_blk_write_time":37,
                  "temp_blks_read":32,
                  "temp_blks_written":33,
                  "toplevel":0,
                  "total_exec_time":11,
                  "total_plan_time":17,
                  "userid":5,
                  "wal_bytes":10,
                  "wal_fpi":23,
                  "wal_records":22
                },
                "renameByName":{
                  "blk_read_time":"Blk RTime",
                  "blk_write_time":"TBlk WTime",
                  "calls":"Calls",
                  "datname":"Database",
                  "dbid":"DBID",
                  "jit_emission_count":"JIT Emission Count",
                  "jit_emission_time":"JIT Emission Time",
                  "jit_functions":"JIT Functions",
                  "jit_generation_time":"JIT Generate Time",
                  "jit_inlining_count":"JIT Inline Count",
                  "jit_inlining_time":"JIT Inline Time",
                  "jit_optimization_count":"JIT Optimize Count",
                  "jit_optimization_time":"JIT Optimize Time",
                  "local_blks_dirtied":"LBlks Dirty",
                  "local_blks_hit":"LBlks Hit",
                  "local_blks_read":"LBlks Read",
                  "local_blks_written":"LBlks Write",
                  "max_exec_time":"RT:max",
                  "max_plan_time":"Plan:max",
                  "mean_exec_time":"RT:avg",
                  "mean_plan_time":"Plan:avg",
                  "min_exec_time":"RT:min",
                  "min_plan_time":"Plan:min",
                  "plans":"Plan",
                  "qid":"Query",
                  "query":"SQL",
                  "queryid":"QID",
                  "rolname":"User",
                  "rows":"Rows",
                  "shared_blks_dirtied":"SBlks Dirty",
                  "shared_blks_hit":"SBlks Hit",
                  "shared_blks_read":"SBlks Read",
                  "shared_blks_written":"SBlks Write",
                  "stddev_exec_time":"RT:\u03c3",
                  "stddev_plan_time":"Plan:\u03c3",
                  "temp_blk_read_time":"TBlk RTime",
                  "temp_blk_write_time":"TBlk WTime",
                  "temp_blks_read":"TBlks Read",
                  "temp_blks_written":"TBlks Write",
                  "toplevel":"Top",
                  "total_exec_time":"Time",
                  "total_plan_time":"Plan:sum",
                  "userid":"UserID",
                  "wal_bytes":"WAL",
                  "wal_fpi":"WAL FPIs",
                  "wal_records":"WAL Recs"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Query",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":33},
      "id":94,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "description":"Roles of this database",
          "fieldConfig":{
            "defaults":{"color":{"fixedColor":"#3e668f","mode":"fixed"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"ConnLimit"},
                "properties":[
                  { "id":"custom.width"      ,"value":90                                                                                                                                                                                                                                                                                },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                                                     },
                  { "id":"color"                                                                                                                                                                                                                                                                                                        },
                  { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"#3e668f","index":1,"text":"NO LIMIT"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"N/A"}},"type":"special"},{"options":{"from":0,"result":{"color":"#f79f64","index":2},"to":99999999},"type":"range"}] }
                ]
              },{
                "matcher":{"id":"byName","options":"Role"},
                "properties":[
                  {"id":"custom.align","value":"center"},{"id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}},{"id":"color","value":{"fixedColor":"text","mode":"thresholds"}},
                  {
                    "id":"mappings",
                    "value":[
                      { "options":{"dbuser_dba":{"color":"#cc4637d9","index":1},"dbuser_monitor":{"color":"#f79f64","index":3},"postgres":{"color":"#b783af","index":0},"replicator":{"color":"#fcdb72","index":2}},"type":"value" },
                      { "options":{"pattern":"dbrole.*","result":{"color":"#3e668f","index":4}}                                                                                                                    ,"type":"regex" },
                      { "options":{"pattern":"dbuser.*","result":{"color":"#346f36cc","index":5}}                                                                                                                  ,"type":"regex" },
                      { "options":{"pattern":"pg_database_owner","result":{"color":"#5b9cd5","index":6}}                                                                                                           ,"type":"regex" }
                    ]
                  },
                  {"id":"custom.minWidth","value":180},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}}
                ]
              },
              {"matcher":{"id":"byType","options":"boolean"},"properties":[{"id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}},{"id":"mappings","value":[{"options":{"false":{"color":"#3e668f","index":0,"text":"F"},"true":{"color":"#f79f64","index":1,"text":"T"}},"type":"value"}]},{"id":"custom.width","value":100}]},
              {"matcher":{"id":"byName","options":"ExpireAt"},"properties":[{"id":"unit","value":"dateTimeFromNow"},{"id":"custom.width","value":90}]},{"matcher":{"id":"byName","options":"OID"},"properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},
              {"matcher":{"id":"byType","options":"boolean"},"properties":[{"id":"custom.filterable","value":true},{"id":"custom.width","value":120}]},{"matcher":{"id":"byName","options":"Login"},"properties":[{"id":"custom.width","value":80}]},{"matcher":{"id":"byName","options":"Inherit"},"properties":[{"id":"custom.width","value":80}]}
            ]
          },
          "gridPos":{"h":11,"w":24,"x":0,"y":159},
          "id":84,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"postgres","uid":"${dsn}"},
              "editorMode":"code",
              "expr":"",
              "format":"table",
              "group":[],
              "legendFormat":"__auto",
              "metricColumn":"none",
              "range":true,
              "rawQuery":true,
              "rawSql":"SELECT r.oid, r.rolname, r.rolsuper, r.rolinherit,\n       r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,\n       r.rolconnlimit, -- r.rolvaliduntil,\n       ARRAY(SELECT b.rolname\n             FROM pg_catalog.pg_auth_members m\n                      JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid)\n             WHERE m.member = r.oid) as memberof\n        , pg_catalog.shobj_description(r.oid, 'pg_authid') AS description\n        , r.rolreplication\n        , r.rolbypassrls\nFROM pg_catalog.pg_roles r\nWHERE r.rolname !~ '^pg_'\nORDER BY 1;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"",
          "transformations":[
            {"id":"seriesToColumns","options":{"byField":"datname"}},
            {
              "id":"organize",
              "options":{
                "excludeByName":{"Time 1":true,"Time 10":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"Time 6":true,"Time 7":true,"Time 8":true,"Time 9":true,"acl":true,"datcollate":true,"datctype":true,"datfrozenxid":true,"description":true,"encoding":true,"tablespace":true},
                "indexByName":{"description":12,"memberof":11,"oid":1,"rolbypassrls":6,"rolcanlogin":2,"rolconnlimit":9,"rolcreatedb":8,"rolcreaterole":7,"rolinherit":3,"rolname":0,"rolreplication":5,"rolsuper":4,"rolvaliduntil":10},
                "renameByName":{
                  "Time 1":"",
                  "Time 7":"",
                  "Value #A":"Size",
                  "Value #B":"Age",
                  "Value #C":"Status",
                  "Value #D":"Session",
                  "Value #E":"TPS",
                  "Value #F":"ConnLimit",
                  "Value #G":"Reserve",
                  "Value #H":"Current",
                  "Value #I":"Disable",
                  "Value #J":"Pause",
                  "acl":"Privileges",
                  "age":"Age",
                  "datallowconn":"Conn",
                  "datcollate":"Collate",
                  "datconnlimit":"ConnLimit",
                  "datctype":"Ctype",
                  "datfrozenxid":"FronzenXID",
                  "datistemplate":"Tmpl",
                  "datname":"Database",
                  "description":"Description",
                  "encoding":"Encoding",
                  "host":"Target",
                  "memberof":"Groups",
                  "oid":"OID",
                  "owner":"Owner",
                  "real_datname":"Datname",
                  "rolbypassrls":"BypassRLS",
                  "rolcanlogin":"Login",
                  "rolconnlimit":"ConnLimit",
                  "rolcreatedb":"CreateDB",
                  "rolcreaterole":"CreateRole",
                  "rolinherit":"Inherit",
                  "rolname":"Role",
                  "rolreplication":"Replication",
                  "rolsuper":"Superuser",
                  "rolvaliduntil":"ExpireAt",
                  "sessions":"Session",
                  "size":"Size",
                  "status":"Status",
                  "tablespace":"Tablespace"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Role",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":34},
      "id":90,
      "panels":[
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"These settings can only be applied when the server starts",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":22,"w":6,"x":0,"y":171},
          "id":130,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/^value$/","values":true},"showPercentChange":false,"text":{"titleSize":12,"valueSize":12},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT extract(EPOCH FROM now()) AS time, name AS metric,setting AS value FROM pg_settings WHERE context = 'postmaster'",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Postmaster",
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"These settings cannot be changed directly; they reflect internally determined values. Some of them may be adjustable by rebuilding the server with different configuration options, or by changing options supplied to initdb.",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":13,"w":6,"x":6,"y":171},
          "id":181,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/^value$/","values":true},"showPercentChange":false,"text":{"titleSize":12,"valueSize":12},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT extract(EPOCH FROM now()) AS time, name AS metric,setting AS value FROM pg_settings WHERE context = 'internal' AND\nname NOT LIKE 'polar%'",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Internal",
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"These settings that has non-default values",
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"auto","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#f79f64"}]}},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"Source"},
                "properties":[
                  { "id":"custom.width"      ,"value":130                                                                                                                                                                                                                                                                                                                                                      },
                  { "id":"mappings"          ,"value":[{"options":{"client":{"color":"#f79f64","index":2},"command line":{"color":"#b783af","index":6},"configuration file":{"color":"#346f36cc","index":1},"database":{"color":"#f79f64","index":4},"default":{"color":"#3e668f","index":0},"environment variable":{"color":"#f79f64","index":3},"override":{"color":"#cc4637d9","index":5}},"type":"value"}] },
                  { "id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}                                                                                                                                                                                                                                                                                                               },
                  { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                                                                                                                                                                     }
                ]
              },{
                "matcher":{"id":"byName","options":"Context"},
                "properties":[
                  { "id":"custom.width"      ,"value":90                                                                                                                                                                                                                                                                                                                                     },
                  { "id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}                                                                                                                                                                                                                                                                                             },
                  { "id":"mappings"          ,"value":[{"options":{"backend":{"color":"#f79f64","index":2},"internal":{"color":"#3e668f","index":0},"postmaster":{"color":"#cc4637d9","index":6},"sighup":{"color":"#346f36cc","index":1},"superuser":{"color":"#f79f64","index":3},"superuser-backend":{"color":"#f79f64","index":5},"user":{"color":"#f79f64","index":4}},"type":"value"}] },
                  { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                                                                                                                                                   }
                ]
              },{
                "matcher":{"id":"byName","options":"Reboot?"},
                "properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"false":{"color":"#3e668f","index":0,"text":"F"},"true":{"color":"#cc4637d9","index":1,"text":"T *"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}},{"id":"custom.align","value":"center"},{"id":"custom.filterable","value":true}]
              },
              {"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},
              {"matcher":{"id":"byName","options":"Value"},"properties":[{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}
            ]
          },
          "gridPos":{"h":22,"w":12,"x":12,"y":171},
          "id":92,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"postgres","uid":"a48cedfc-b0bf-40da-aafb-23f7954b8000"},
              "editorMode":"code",
              "expr":"",
              "format":"table",
              "group":[],
              "legendFormat":"__auto",
              "metricColumn":"none",
              "range":true,
              "rawQuery":true,
              "rawSql":"SELECT name,setting,source,context,pending_restart FROM pg_settings;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Changed",
          "transformations":[
            {
              "id":"organize",
              "options":{"excludeByName":{"boot_val":true,"category":true,"context":false,"enumvals":true,"extra_desc":true,"max_val":true,"min_val":true,"pending_restart":false,"reset_val":true,"short_desc":true,"sourcefile":true,"sourceline":true,"unit":true,"vartype":true},"indexByName":{},"renameByName":{"context":"Context","name":"Name","pending_restart":"Reboot?","setting":"Value","source":"Source"}}
            }
          ],
          "type":"table"
        },
        {
          "datasource":{"uid":"${dsn}"},
          "description":"Info from pg_control_system",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":9,"w":6,"x":6,"y":184},
          "id":129,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":[],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":12},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[{"format":"table","group":[],"metricColumn":"none","rawQuery":true,"rawSql":"SELECT * FROM pg_control_init();","refId":"A","select":[[{"params":["value"],"type":"column"}]],"timeColumn":"time","where":[{"name":"$__timeFilter","params":[],"type":"macro"}]}],
          "title":"Init Parameters",
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"Archive Command & Primary Info",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":2,"w":24,"x":0,"y":193},
          "id":182,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/^value$/","values":true},"showPercentChange":false,"text":{"titleSize":12,"valueSize":12},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT extract(EPOCH FROM now()) AS time, name AS metric,setting AS value FROM pg_settings WHERE name = 'archive_command' or name = 'primary_conninfo';",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"",
          "type":"stat"
        }
      ],
      "title":"Settings",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":35},
      "id":98,
      "panels":[
        {
          "datasource":{"uid":"${dsn}"},
          "description":"The pg_stat_replication view will contain one row per WAL sender process, showing statistics about replication to that sender's connected standby server. Only directly connected standbys are listed; no information is available about downstream standby servers.",
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"State"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                                                                                                                               },
                  { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"#b783af","index":0,"text":"unknown"},"0":{"color":"#346f36cc","index":1,"text":"streaming"},"1":{"color":"red","index":2,"text":"startup"},"2":{"color":"#fcdb72","index":3,"text":"catchup"},"3":{"color":"#3e668f","index":4,"text":"backup"},"4":{"color":"#f79f64","index":5,"text":"stopping"}},"type":"value"}] },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                                                                                                                     }
                ]
              },{
                "matcher":{"id":"byName","options":"Sync State"},
                "properties":[
                  { "id":"custom.width"      ,"value":90                                                                                                                                                                                                                                                                                           },
                  { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"#b783af","index":4,"text":"unknown"},"0":{"color":"#346f36cc","index":0,"text":"async"},"1":{"color":"#fcdb72","index":1,"text":"potential"},"2":{"color":"#3e668f","index":2,"text":"sync"},"3":{"color":"#f79f64","index":3,"text":"quorum"}},"type":"value"}] },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                                                                },
                  { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                                                                        }
                ]
              },
              {"matcher":{"id":"byName","options":"App"},"properties":[{"id":"links","value":[{"title":"PGSQL Instance for replication destination instance ${__data.fields.DST}","url":"/d/pgsql-instance?var-ins=${__data.fields.DST}&${__url_time_range}"}]}]},{"matcher":{"id":"byName","options":"reply_time"},"properties":[{"id":"unit","value":"dateTimeFromNow"}]},
              {"matcher":{"id":"byName","options":"Priority"},"properties":[{"id":"custom.width","value":70},{"id":"mappings","value":[{"options":{"0":{"color":"#3e668f","index":0,"text":"0"},"1":{"color":"#f79f64","index":1,"text":"Sync"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {"matcher":{"id":"byRegexp","options":"/lags.*/"},"properties":[{"id":"unit","value":"s"},{"id":"custom.width","value":85}]},
              {
                "matcher":{"id":"byRegexp","options":"/lagB.*/"},
                "properties":[
                  { "id":"unit"              ,"value":"decbytes"                                                                                                                                                                                                                      },
                  { "id":"custom.width"      ,"value":85                                                                                                                                                                                                                              },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#fcdb72","value":1000},{"color":"#f79f64","value":100000},{"color":"red","value":1000000},{"color":"#b783af","value":10000000},{"color":"text","value":100000000}]} },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                   }
                ]
              },
              {"matcher":{"id":"byRegexp","options":"/lags.*/"},"properties":[{"id":"unit","value":"s"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#fcdb72","value":0.1},{"color":"#f79f64","value":1},{"color":"red","value":4},{"color":"#b783af","value":16},{"color":"text","value":64}]}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"PID"},"properties":[{"id":"custom.width","value":70}]}
            ]
          },
          "gridPos":{"h":6,"w":24,"x":0,"y":196},
          "id":140,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT application_name                                                 AS appname,\n       usename,\n       coalesce(abbrev(client_addr), 'localhost') || ':' || client_port AS address,\n       pid,\n       state,\n       sync_state,\n       sync_priority,\n       backend_xmin::TEXT::BIGINT                                       AS backend_xmin,\n       current.lsn - '0/0'                                              AS lsn,\n       current.lsn - sent_lsn                                           AS sent_diff,\n       current.lsn - write_lsn                                          AS write_diff,\n       current.lsn - flush_lsn                                          AS flush_diff,\n       current.lsn - replay_lsn                                         AS replay_diff,\n       coalesce(extract(EPOCH FROM write_lag), 0)                       AS write_lag,\n       coalesce(extract(EPOCH FROM flush_lag), 0)                       AS flush_lag,\n       coalesce(extract(EPOCH FROM replay_lag), 0)                      AS replay_lag,\n       extract(EPOCH FROM current_timestamp)                            AS \"time\",\n       extract(EPOCH FROM backend_start)                                AS launch_time,\n       extract(EPOCH FROM reply_time)                                   AS reply_time\nFROM pg_stat_replication,\n     (SELECT CASE WHEN pg_is_in_recovery() THEN pg_last_wal_replay_lsn() ELSE pg_current_wal_lsn() END AS lsn) current;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Replication Stats",
          "transformations":[
            {"id":"seriesToColumns","options":{"byField":"appname"}},
            {
              "id":"organize",
              "options":{
                "excludeByName":{
                  "Time":true,
                  "Time 1":true,
                  "Time 2":true,
                  "Value #A":false,
                  "__name__":true,
                  "__name__ 1":true,
                  "__name__ 2":true,
                  "address":false,
                  "backend_xmin":true,
                  "client_hostname":true,
                  "cls":true,
                  "cls 1":true,
                  "cls 2":true,
                  "flush_lsn":true,
                  "job":true,
                  "job 1":true,
                  "job 2":true,
                  "launch_time":true,
                  "lsn":true,
                  "pid":false,
                  "replay_lsn":true,
                  "reply_time":true,
                  "sender_host":true,
                  "sender_port":true,
                  "sent_lsn":true,
                  "time":true,
                  "usename":false,
                  "write_lsn":true
                },
                "indexByName":{"address":1,"appname":0,"backend_xmin":14,"flush_diff":10,"flush_lag":13,"flush_lsn":18,"launch_time":21,"lsn":15,"pid":3,"replay_diff":7,"replay_lag":11,"replay_lsn":19,"reply_time":22,"sent_diff":8,"sent_lsn":16,"state":4,"sync_priority":6,"sync_state":5,"time":20,"usename":2,"write_diff":9,"write_lag":12,"write_lsn":17},
                "renameByName":{
                  "Value #A":"SYNC",
                  "Value #B":"TLI",
                  "address":"Client",
                  "appname":"App",
                  "client_port":"",
                  "flush_diff":"lagB(flush)",
                  "flush_lag":"lags(flush)",
                  "flush_lsn":"",
                  "ins":"SRC",
                  "pid":"PID",
                  "replay_diff":"lagB",
                  "replay_lag":"lags",
                  "replay_lsn":"",
                  "sender_host":"",
                  "sender_port":"",
                  "sent_diff":"lagB(sent)",
                  "slot_name":"SLOT",
                  "state":"State",
                  "sync_priority":"Priority",
                  "sync_state":"Sync State",
                  "usename":"User",
                  "write_diff":"lagB(write)",
                  "write_lag":"lags(write)",
                  "write_lsn":""
                }
              }
            }
          ],
          "type":"table"
        },
        {
          "datasource":{"uid":"${dsn}"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"Retained"},
                "properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#f79f64","value":1000000000},{"color":"#cc4637d9","value":100000000000}]}},{"id":"unit","value":"decbytes"},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]
              },
              {"matcher":{"id":"byName","options":"Active"},"properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"false":{"color":"#f79f64","index":0,"text":"Inactive"},"true":{"color":"#346f36cc","index":1,"text":"Active"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"Temporary"},"properties":[{"id":"custom.width","value":100},{"id":"mappings","value":[{"options":{"false":{"color":"#346f36cc","index":0,"text":"Permanent"},"true":{"color":"#f79f64","index":1,"text":"Temporary"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {
                "matcher":{"id":"byName","options":"Status"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                                                                                                 },
                  { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"rgba(128, 128, 128, 1)","index":4,"text":"Unknown"},"0":{"color":"#346f36cc","index":0,"text":"Reserved"},"1":{"color":"#fcdb72","index":1,"text":"Extended"},"2":{"color":"#f79f64","index":2,"text":"Unreserved"},"3":{"color":"#cc4637d9","index":3,"text":"Lost"}},"type":"value"}] },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                                                                                       }
                ]
              },
              {"matcher":{"id":"byName","options":"Restart LSN"},"properties":[{"id":"unit","value":"hex"},{"id":"custom.width","value":126}]},{"matcher":{"id":"byName","options":"PID"},"properties":[{"id":"custom.width","value":70}]},{"matcher":{"id":"byName","options":"XMIN"},"properties":[{"id":"custom.width","value":100}]},
              {"matcher":{"id":"byName","options":"Cat XMIN"},"properties":[{"id":"custom.width","value":100}]},{"matcher":{"id":"byName","options":"Restart LSN"},"properties":[{"id":"custom.width","value":130}]},{"matcher":{"id":"byName","options":"Confirmed"},"properties":[{"id":"custom.width","value":130}]},
              {"matcher":{"id":"byName","options":"Safe Size"},"properties":[{"id":"custom.width","value":95},{"id":"unit","value":"decbytes"}]},{"matcher":{"id":"byName","options":"Two Phase"},"properties":[{"id":"custom.width","value":90},{"id":"mappings","value":[{"options":{"false":{"color":"#346f36cc","index":1,"text":"Disabled"},"true":{"color":"#f79f64","index":0,"text":"Enabled"}},"type":"value"}]}]},
              {"matcher":{"id":"byName","options":"Failover"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#f79f64","index":1,"text":"Disabled"},"true":{"color":"#346f36cc","index":0,"text":"Enabled"}},"type":"value"}]},{"id":"custom.width","value":80}]},
              {"matcher":{"id":"byName","options":"Synced"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#346f36cc","index":1,"text":"No"},"true":{"color":"#f79f64","index":0,"text":"Yes"}},"type":"value"}]},{"id":"custom.width","value":70}]},{"matcher":{"id":"byName","options":"Reason"},"properties":[{"id":"custom.minWidth","value":100}]},
              {"matcher":{"id":"byName","options":"Conflict"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#346f36cc","index":1,"text":"NO"},"true":{"color":"red","index":0,"text":"CONFLICT"}},"type":"value"}]},{"id":"color"},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"custom.width","value":80}]},
              {"matcher":{"id":"byName","options":"Inactive Since"},"properties":[{"id":"custom.width","value":180}]}
            ]
          },
          "gridPos":{"h":6,"w":24,"x":0,"y":202},
          "id":142,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT *, \nCASE WHEN pg_is_in_recovery() THEN pg_last_wal_replay_lsn() ELSE pg_current_wal_lsn() END - restart_lsn AS retain \nFROM pg_replication_slots \nWHERE slot_type = 'physical';",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Replication Slots (Physical)",
          "transformations":[
            {"id":"seriesToColumns","options":{"byField":"slot_name"}},
            {
              "id":"organize",
              "options":{
                "excludeByName":{"Time 1":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"database":true,"datoid":true,"ins":true,"plugin":true,"slot_type":true},
                "includeByName":{},
                "indexByName":{"active":6,"active_pid":10,"catalog_xmin":12,"confirmed_flush_lsn":14,"conflicting":18,"database":3,"datoid":16,"failover":7,"inactive_since":20,"invalidation_reason":19,"plugin":1,"restart_lsn":13,"retain":9,"safe_wal_size":15,"slot_name":0,"slot_type":2,"synced":8,"temporary":5,"two_phase":17,"wal_status":4,"xmin":11},
                "renameByName":{
                  "Value #A":"Retained",
                  "Value #B":"Active",
                  "Value #C":"Tmp",
                  "Value #D":"Status",
                  "Value #E":"Restart LSN",
                  "active":"Active",
                  "active_pid":"PID",
                  "catalog_xmin":"Cat XMIN",
                  "confirmed_flush_lsn":"Confirmed",
                  "conflicting":"Conflict",
                  "database":"Database",
                  "datoid":"",
                  "failover":"Failover",
                  "inactive_since":"Inactive Since",
                  "ins":"Instance",
                  "invalidation_reason":"Reason",
                  "plugin":"Plugin",
                  "restart_lsn":"Restart LSN",
                  "retain":"Retained",
                  "safe_wal_size":"Safe Size",
                  "slot_name":"Slot",
                  "slot_type":"Slot Type",
                  "synced":"Synced",
                  "temporary":"Temporary",
                  "two_phase":"Two Phase",
                  "wal_status":"Status",
                  "xmin":"XMIN"
                }
              }
            }
          ],
          "type":"table"
        },
        {
          "datasource":{"uid":"${dsn}"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"Retained"},
                "properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#f79f64","value":1000000000},{"color":"red","value":100000000000}]}},{"id":"unit","value":"decbytes"},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]
              },
              {"matcher":{"id":"byName","options":"Active"},"properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"false":{"color":"#f79f64","index":0,"text":"Inactive"},"true":{"color":"#346f36cc","index":1,"text":"Active"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"Temporary"},"properties":[{"id":"custom.width","value":100},{"id":"mappings","value":[{"options":{"false":{"color":"#346f36cc","index":0,"text":"Permanent"},"true":{"color":"#f79f64","index":1,"text":"Temporary"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {
                "matcher":{"id":"byName","options":"Status"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                                                                                           },
                  { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"rgba(128, 128, 128, 1)","index":4,"text":"Unknown"},"0":{"color":"#346f36cc","index":0,"text":"Reserved"},"1":{"color":"#fcdb72","index":1,"text":"Extended"},"2":{"color":"#f79f64","index":2,"text":"Unreserved"},"3":{"color":"red","index":3,"text":"Lost"}},"type":"value"}] },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                                                                                 }
                ]
              },
              {"matcher":{"id":"byName","options":"Restart LSN"},"properties":[{"id":"unit","value":"hex"},{"id":"custom.width","value":126}]},{"matcher":{"id":"byName","options":"PID"},"properties":[{"id":"custom.width","value":70}]},{"matcher":{"id":"byName","options":"XMIN"},"properties":[{"id":"custom.width","value":100}]},
              {"matcher":{"id":"byName","options":"Cat XMIN"},"properties":[{"id":"custom.width","value":100}]},{"matcher":{"id":"byName","options":"Restart LSN"},"properties":[{"id":"custom.width","value":130}]},{"matcher":{"id":"byName","options":"Confirmed"},"properties":[{"id":"custom.width","value":130}]},
              {"matcher":{"id":"byName","options":"Safe Size"},"properties":[{"id":"custom.width","value":75},{"id":"unit","value":"decbytes"}]}
            ]
          },
          "gridPos":{"h":6,"w":24,"x":0,"y":208},
          "id":144,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT *, \nCASE WHEN pg_is_in_recovery() THEN pg_last_wal_replay_lsn() ELSE pg_current_wal_lsn() END - restart_lsn AS retain \nFROM pg_replication_slots \nWHERE slot_type = 'logical';",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Replication Slots (Logical)",
          "transformations":[
            {"id":"seriesToColumns","options":{"byField":"slot_name"}},
            {
              "id":"organize",
              "options":{
                "excludeByName":{"Time 1":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"datoid":true,"ins":true,"slot_type":false},
                "indexByName":{"active":5,"active_pid":7,"catalog_xmin":9,"confirmed_flush_lsn":11,"database":2,"datoid":14,"plugin":1,"restart_lsn":10,"retain":6,"safe_wal_size":12,"slot_name":0,"slot_type":13,"temporary":4,"wal_status":3,"xmin":8},
                "renameByName":{
                  "Value #A":"Retained",
                  "Value #B":"Active",
                  "Value #C":"Tmp",
                  "Value #D":"Status",
                  "Value #E":"Restart LSN",
                  "active":"Active",
                  "active_pid":"PID",
                  "catalog_xmin":"Cat XMIN",
                  "confirmed_flush_lsn":"Confirmed",
                  "database":"Database",
                  "datoid":"",
                  "ins":"Instance",
                  "plugin":"Plugin",
                  "restart_lsn":"Restart LSN",
                  "retain":"Retained",
                  "safe_wal_size":"Safe Size",
                  "slot_name":"Slot",
                  "slot_type":"Slot Type",
                  "temporary":"Temporary",
                  "wal_status":"Status",
                  "xmin":"XMIN"
                }
              }
            }
          ],
          "type":"table"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"The pg_stat_wal_receiver view will contain only one row, showing statistics about the WAL receiver from that receiver's connected server.",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":14,"w":8,"x":0,"y":214},
          "id":146,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-test-1.test"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT * FROM pg_stat_wal_receiver;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"WAL Receiver (Replica Only)",
          "transformations":[{"id":"organize","options":{"excludeByName":{"conninfo":true},"indexByName":{},"renameByName":{}}}],
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"The pg_stat_wal_receiver view will contain only one row, showing statistics about the WAL receiver from that receiver's connected server.",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":14,"w":8,"x":8,"y":214},
          "id":147,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-test-1.test"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT * FROM pg_stat_subscription;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"Subscription",
          "transformations":[{"id":"organize","options":{"excludeByName":{"conninfo":true},"indexByName":{},"renameByName":{}}}],
          "type":"stat"
        },
        {
          "datasource":{"uid":"${dsn}"},
          "description":"Publication Information",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":14,"w":8,"x":16,"y":214},
          "id":148,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[{"format":"table","group":[],"metricColumn":"none","rawQuery":true,"rawSql":"SELECT * FROM pg_publication;","refId":"A","select":[[{"params":["value"],"type":"column"}]],"timeColumn":"time","where":[{"name":"$__timeFilter","params":[],"type":"macro"}]}],
          "title":"Publication",
          "transformations":[{"id":"organize","options":{"excludeByName":{"conninfo":true},"indexByName":{},"renameByName":{}}}],
          "type":"stat"
        }
      ],
      "title":"Replication",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":36},
      "id":121,
      "panels":[
        {
          "datasource":{"uid":"${dsn}"},
          "description":"PostgreSQL server's main shared memory segment.",
          "fieldConfig":{
            "defaults":{"custom":{"align":"center","cellOptions":{"type":"auto"},"filterable":false,"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
            "overrides":[{"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"unit","value":"decbytes"},{"id":"decimals"},{"id":"custom.width","value":120}]},{"matcher":{"id":"byName","options":"Offset"},"properties":[{"id":"unit","value":"hex0x"},{"id":"custom.width","value":120}]}]
          },
          "gridPos":{"h":10,"w":8,"x":0,"y":229},
          "id":118,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"Size"}]},
          "pluginVersion":"11.6.0",
          "targets":[{"format":"table","group":[],"metricColumn":"none","rawQuery":true,"rawSql":"SELECT coalesce(name, 'Free') AS name, off AS offset, allocated_size AS size FROM pg_shmem();","refId":"A","select":[[{"params":["value"],"type":"column"}]],"timeColumn":"time","where":[{"name":"$__timeFilter","params":[],"type":"macro"}]}],
          "title":"",
          "transformations":[{"id":"organize","options":{"excludeByName":{},"indexByName":{},"renameByName":{"name":"Name","offset":"Offset","size":"Size"}}}],
          "type":"table"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"PostgreSQL server's main shared memory segment.",
          "fieldConfig":{
            "defaults":{"color":{"mode":"palette-classic"},"custom":{"hideFrom":{"legend":false,"tooltip":false,"viz":false}},"mappings":[],"unit":"decbytes"},
            "overrides":[
              {"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"unit","value":"decbytes"},{"id":"decimals"}]},{"matcher":{"id":"byName","options":"Offset"},"properties":[{"id":"unit","value":"hex0x"}]},
              {
                "__systemRef":"hideSeriesFrom",
                "matcher":{
                  "id":"byNames",
                  "options":{
                    "mode":"exclude",
                    "names":[
                      "size <anonymous>","size Async Queue Control","size AutoVacuum Data","size BTree Vacuum State","size Backend Activity Buffer","size Backend Application Name Buffer","size Backend Client Host Name Buffer","size Backend GSS Status Buffer","size Backend SSL Status Buffer","size Backend Status Array","size Background Worker Data","size Buffer Descriptors","size Buffer IO Locks",
                      "size Buffer Strategy Status","size Checkpoint BufferIds","size Checkpointer Data","size CommitTs","size CommitTs shared","size Control File","size Fast Path Strong Relation Lock Data","size FinishedSerializableTransactions","size Free","size KnownAssignedXids","size KnownAssignedXidsValid","size LOCK hash","size Logical Replication Launcher Data","size MultiXactMember","size MultiXactOffset",
                      "size Notify","size OldSnapshotControlData","size PMSignalState","size PREDICATELOCK hash","size PREDICATELOCKTARGET hash","size PROCLOCK hash","size PredXactList","size Prepared Transaction Table","size Proc Array","size Proc Header","size ProcSignal","size RWConflictPool","size ReplicationOriginState","size ReplicationSlot Ctl","size SERIALIZABLEXID hash","size Serial","size SerialControlData",
                      "size Shared Buffer Lookup Table","size Shared MultiXact State","size Subtrans","size Sync Scan Locations List","size Wal Receiver Ctl","size Wal Sender Ctl","size XLOG Ctl","size Xact","size pg_stat_statements","size pg_stat_statements hash","size shmInvalBuffer"
                    ],
                    "prefix":"All except:",
                    "readOnly":true
                  }
                },
                "properties":[{"id":"custom.hideFrom","value":{"legend":false,"tooltip":false,"viz":true}}]
              }
            ]
          },
          "gridPos":{"h":10,"w":16,"x":8,"y":229},
          "id":122,
          "options":{"legend":{"displayMode":"table","placement":"right","showLegend":true,"values":["value"]},"pieType":"pie","reduceOptions":{"calcs":[],"fields":"","values":false},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"time_series",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT extract(EPOCH FROM now()) AS time, coalesce(name, 'Free') AS name, allocated_size AS size FROM pg_shmem() ORDER BY 2 DESC;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_shmem",
          "transformations":[{"id":"organize","options":{"excludeByName":{},"indexByName":{},"renameByName":{"name":"Name","offset":"Offset","size":"Size"}}}],
          "type":"piechart"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"PostgreSQL server's main shared memory segment.",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},"overrides":[]},
          "gridPos":{"h":10,"w":8,"x":0,"y":239},
          "id":127,
          "options":{"colorField":"size","sizeField":"size","tiling":"treemapBinary"},
          "pluginVersion":"2.0.1",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT extract(EPOCH FROM now()) AS time, coalesce(name, 'Free') AS name, allocated_size AS size FROM pg_shmem() ORDER BY 2 DESC;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_shmem",
          "transformations":[{"id":"organize","options":{"excludeByName":{},"indexByName":{},"renameByName":{"name":"Name","offset":"Offset","size":"Size"}}}],
          "type":"marcusolsson-treemap-panel"
        },{
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "description":"PostgreSQL accesses certain on-disk information via SLRU (simple least-recently-used) caches. The pg_stat_slru view will contain one row for each tracked SLRU cache, showing statistics about access to cached pages.",
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"filterable":false,"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
            "overrides":[{"matcher":{"id":"byName","options":"stats_reset"},"properties":[{"id":"custom.width","value":160},{"id":"unit","value":"dateTimeFromNow"}]},{"matcher":{"id":"byType","options":"number"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"},{"color":"#346f36cc","value":1}]}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]}]
          },
          "gridPos":{"h":10,"w":16,"x":8,"y":239},
          "id":113,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT name,blks_zeroed,blks_hit,blks_read,blks_written,blks_exists,flushes,truncates FROM pg_stat_slru",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_stat_slru",
          "transformations":[{"id":"reduce","options":{"reducers":[]}}],
          "type":"table"
        }
      ],
      "title":"Memory",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":37},
      "id":115,
      "panels":[
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":2,"w":6,"x":0,"y":250},
          "id":155,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":12},"textMode":"value_and_name","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"postgres","uid":"${dsn}"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"select to_timestamp(((system_identifier>>32) & (2^32 -1)::bigint))::TEXT AS \"Cluster Created At\" FROM pg_control_system();",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"",
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":8,"w":6,"x":6,"y":250},
          "id":126,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":[],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT \npg_control_version,\ncatalog_version_no,\nsystem_identifier\t,\nextract(EPOCH FROM pg_control_last_modified) * 1000 AS last_modified\nFROM pg_control_system();",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_control_system",
          "transformations":[{"id":"organize","options":{"excludeByName":{},"includeByName":{},"indexByName":{},"renameByName":{"pg_control_version":""}}}],
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":16,"w":6,"x":12,"y":250},
          "id":119,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"value_and_name","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-test-1.test"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT \n wal_records      ,\n wal_fpi          ,\n wal_bytes        ,\n wal_buffers_full ,\n wal_write        ,\n wal_sync         ,\n wal_write_time   ,\n wal_sync_time    \nFROM pg_stat_wal;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_stat_wal",
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[]},
          "gridPos":{"h":16,"w":6,"x":18,"y":250},
          "id":123,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"value_and_name","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-test-1.test"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT * FROM pg_stat_bgwriter;",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            },{
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-test-1.test"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "hide":false,
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT * FROM pg_stat_checkpointer;",
              "refId":"B",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_stat_bgwriter / checkpointer",
          "type":"stat"
        },
        {
          "datasource":{"type":"grafana-postgresql-datasource","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[{"matcher":{"id":"byName","options":"full_page_writes"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#f79f64","index":0},"true":{"color":"#3e668f","index":1}},"type":"value"}]}]}]},
          "gridPos":{"h":14,"w":6,"x":0,"y":252},
          "id":116,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"grafana-postgresql-datasource","uid":"pg-meta-1.meta"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT\n    checkpoint_lsn,\n    redo_lsn,\n    redo_wal_file,\n    timeline_id,\n    prev_timeline_id,\n    full_page_writes,\n    next_xid,\n    next_oid,\n    next_multixact_id,\n    next_multi_offset,\n    oldest_xid,\n    oldest_xid_dbid,\n    oldest_active_xid,\n    oldest_multi_xid,\n    oldest_multi_dbid,\n    oldest_commit_ts_xid,\n    newest_commit_ts_xid,\n    checkpoint_time::text\nFROM pg_control_checkpoint();",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_control_checkpoint",
          "type":"stat"
        },
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},"overrides":[{"matcher":{"id":"byName","options":"end_of_backup_record_required"},"properties":[{"id":"mappings","value":[{"options":{"false":{"color":"#3e668f","index":0},"true":{"color":"#3e668f","index":1}},"type":"value"}]}]}]},
          "gridPos":{"h":8,"w":6,"x":6,"y":258},
          "id":125,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":[],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"auto","wideLayout":true},
          "pluginVersion":"11.6.0",
          "targets":[
            {
              "datasource":{"type":"postgres","uid":"cc8a3615-9c82-44d7-be42-07d8aa1cac68"},
              "editorMode":"code",
              "format":"table",
              "group":[],
              "metricColumn":"none",
              "rawQuery":true,
              "rawSql":"SELECT * FROM pg_control_recovery();",
              "refId":"A",
              "select":[[{"params":["value"],"type":"column"}]],
              "sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50},
              "timeColumn":"time",
              "where":[{"name":"$__timeFilter","params":[],"type":"macro"}]
            }
          ],
          "title":"pg_control_recovery",
          "type":"stat"
        }
      ],
      "title":"Persist",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":38},
      "id":160,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
            "overrides":[
              {"matcher":{"id":"byName","options":"Label"},"properties":[{"id":"custom.width","value":314}]},{"matcher":{"id":"byName","options":"Stanza"},"properties":[{"id":"custom.width","value":100},{"id":"links","value":[{"title":"PGSQL Cluster: ${__data.fields.Stanza}","url":"/d/pgsql-cluster?var-cls=${__data.fields.Stanza}&${__url_time_range}"}]}]},
              {
                "matcher":{"id":"byName","options":"Type"},
                "properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"diff":{"color":"#f79f64","index":2,"text":"DIFF"},"full":{"color":"#346f36cc","index":0,"text":"FULL"},"incr":{"color":"#3e668f","index":1,"text":"INCR"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"custom.filterable","value":true}]
              },
              {"matcher":{"id":"byName","options":"Error"},"properties":[{"id":"custom.width","value":70},{"id":"mappings","value":[{"options":{"false":{"color":"#346f36cc","index":0,"text":"OK"},"true":{"color":"#cc4637d9","index":1,"text":"FAIL"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]},
              {"matcher":{"id":"byName","options":"min(WAL)"},"properties":[{"id":"custom.width","value":235}]},{"matcher":{"id":"byName","options":"max(WAL)"},"properties":[{"id":"custom.width","value":235}]},{"matcher":{"id":"byName","options":"StartTs"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"StartLSN"},"properties":[{"id":"custom.width","value":100}]},
              {"matcher":{"id":"byName","options":"StopLSN"},"properties":[{"id":"custom.width","value":100}]},{"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"custom.width","value":100},{"id":"unit","value":"decbytes"}]},{"matcher":{"id":"byName","options":"Delta"},"properties":[{"id":"custom.width","value":100},{"id":"unit","value":"decbytes"}]},
              {"matcher":{"id":"byName","options":"RepoSize"},"properties":[{"id":"custom.width","value":80},{"id":"unit","value":"decbytes"}]},{"matcher":{"id":"byName","options":"RepoDelta"},"properties":[{"id":"custom.width","value":85},{"id":"unit","value":"decbytes"}]},
              {"matcher":{"id":"byName","options":"Reference"},"properties":[{"id":"custom.width","value":120},{"id":"custom.inspect","value":true},{"id":"custom.cellOptions","value":{"type":"json-view"}}]},{"matcher":{"id":"byName","options":"Annotation"},"properties":[{"id":"custom.cellOptions","value":{"type":"json-view"}},{"id":"custom.inspect","value":true}]}
            ]
          },
          "gridPos":{"h":10,"w":24,"x":0,"y":267},
          "id":158,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"StopAt"}]},
          "pluginVersion":"11.6.0",
          "targets":[{"datasource":{"type":"postgres","uid":"${dsn}"},"editorMode":"code","format":"table","rawQuery":true,"rawSql":"SELECT * FROM pgbackrest\nWHERE name = '${cls}';","refId":"A","sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50}}],
          "title":"pgBackRest Backup Info",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{"bk_start_ts":true,"bk_stop_ts":true},
                "indexByName":{"bk_annotation":18,"bk_delta":5,"bk_error":3,"bk_label":1,"bk_prior":8,"bk_reference":17,"bk_repo_delta":16,"bk_repo_size":15,"bk_size":4,"bk_start_at":11,"bk_start_lsn":13,"bk_start_ts":9,"bk_stop_at":12,"bk_stop_lsn":14,"bk_stop_ts":10,"bk_type":2,"name":0,"wal_max":7,"wal_min":6},
                "renameByName":{
                  "bk_annotation":"Annotation",
                  "bk_delta":"Delta",
                  "bk_error":"Error",
                  "bk_label":"Label",
                  "bk_prior":"Prior",
                  "bk_reference":"Reference",
                  "bk_repo_delta":"RepoDelta",
                  "bk_repo_size":"RepoSize",
                  "bk_size":"Size",
                  "bk_start_at":"StartAt",
                  "bk_start_lsn":"StartLSN",
                  "bk_start_ts":"StartTs",
                  "bk_stop_at":"StopAt",
                  "bk_stop_lsn":"StopLSN",
                  "bk_stop_ts":"StopTs",
                  "bk_type":"Type",
                  "name":"Stanza",
                  "wal_max":"max(WAL)",
                  "wal_min":"min(WAL)"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Backup",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":39},
      "id":164,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},"overrides":[{"matcher":{"id":"byName","options":"Value"},"properties":[{"id":"custom.width"}]},{"matcher":{"id":"byName","options":"Key"},"properties":[{"id":"custom.width","value":280}]}]},
          "gridPos":{"h":16,"w":10,"x":0,"y":278},
          "id":170,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[{"datasource":{"type":"postgres","uid":"${dsn}"},"editorMode":"code","format":"table","rawQuery":true,"rawSql":"SELECT key, value FROM patroni_conf d, jsonb_each(d.data)  WHERE key != 'postgresql' ;\n-- WHERE name = '${cls}';","refId":"A","sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50}}],
          "title":"Patroni Conf",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{"bk_start_ts":true,"bk_stop_ts":true,"clonefrom":false,"nofailover":false,"noloadbalance":false,"nosync":false,"replicatefrom":false},
                "indexByName":{"clonefrom":10,"host":2,"lag":6,"name":1,"nofailover":9,"noloadbalance":11,"nosync":12,"port":3,"replicatefrom":8,"role":0,"state":4,"tags":13,"timeline":5,"url":7},
                "renameByName":{
                  "bk_annotation":"Annotation",
                  "bk_delta":"Delta",
                  "bk_error":"Error",
                  "bk_label":"Label",
                  "bk_prior":"Prior",
                  "bk_reference":"Reference",
                  "bk_repo_delta":"RepoDelta",
                  "bk_repo_size":"RepoSize",
                  "bk_size":"Size",
                  "bk_start_at":"StartAt",
                  "bk_start_lsn":"StartLSN",
                  "bk_start_ts":"StartTs",
                  "bk_stop_at":"StopAt",
                  "bk_stop_lsn":"StopLSN",
                  "bk_stop_ts":"StopTs",
                  "bk_type":"Type",
                  "clonefrom":"CloneFrom",
                  "host":"Host",
                  "key":"Key",
                  "lag":"Lag",
                  "name":"Cluster",
                  "nofailover":"NoFailover",
                  "noloadbalance":"NoLoadbalance",
                  "nosync":"NoSync",
                  "port":"Port",
                  "replicatefrom":"ReplicateFrom",
                  "role":"Role",
                  "state":"State",
                  "tags":"Tags",
                  "timeline":"Timeline",
                  "url":"URL",
                  "value":"Value",
                  "wal_max":"max(WAL)",
                  "wal_min":"min(WAL)"
                }
              }
            }
          ],
          "type":"table"
        },{
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
            "overrides":[{"matcher":{"id":"byName","options":"Value"},"properties":[{"id":"custom.width"}]},{"matcher":{"id":"byName","options":"Key"},"properties":[{"id":"custom.width","value":280},{"id":"custom.align","value":"left"}]}]
          },
          "gridPos":{"h":16,"w":14,"x":10,"y":278},
          "id":171,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":false,"displayName":"Key"}]},
          "pluginVersion":"11.6.0",
          "targets":[{"datasource":{"type":"postgres","uid":"${dsn}"},"editorMode":"code","format":"table","rawQuery":true,"rawSql":"SELECT key, value FROM (SELECT value->'parameters' AS v FROM patroni_conf d, jsonb_each(d.data)  WHERE key = 'postgresql') p, jsonb_each(p.v);","refId":"A","sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50}}],
          "title":"PostgreSQL Parameters",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{"bk_start_ts":true,"bk_stop_ts":true,"clonefrom":false,"nofailover":false,"noloadbalance":false,"nosync":false,"replicatefrom":false},
                "indexByName":{"clonefrom":10,"host":2,"lag":6,"name":1,"nofailover":9,"noloadbalance":11,"nosync":12,"port":3,"replicatefrom":8,"role":0,"state":4,"tags":13,"timeline":5,"url":7},
                "renameByName":{
                  "bk_annotation":"Annotation",
                  "bk_delta":"Delta",
                  "bk_error":"Error",
                  "bk_label":"Label",
                  "bk_prior":"Prior",
                  "bk_reference":"Reference",
                  "bk_repo_delta":"RepoDelta",
                  "bk_repo_size":"RepoSize",
                  "bk_size":"Size",
                  "bk_start_at":"StartAt",
                  "bk_start_lsn":"StartLSN",
                  "bk_start_ts":"StartTs",
                  "bk_stop_at":"StopAt",
                  "bk_stop_lsn":"StopLSN",
                  "bk_stop_ts":"StopTs",
                  "bk_type":"Type",
                  "clonefrom":"CloneFrom",
                  "host":"Host",
                  "key":"Key",
                  "lag":"Lag",
                  "name":"Cluster",
                  "nofailover":"NoFailover",
                  "noloadbalance":"NoLoadbalance",
                  "nosync":"NoSync",
                  "port":"Port",
                  "replicatefrom":"ReplicateFrom",
                  "role":"Role",
                  "state":"State",
                  "tags":"Tags",
                  "timeline":"Timeline",
                  "url":"URL",
                  "value":"Value",
                  "wal_max":"max(WAL)",
                  "wal_min":"min(WAL)"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Patroni",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":40},
      "id":166,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false,"width":80},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
            "overrides":[
              { "matcher":{"id":"byName","options":"username"}   ,"properties":[{"id":"custom.width","value":120}]                                                                                                                   },
              { "matcher":{"id":"byName","options":"command"}    ,"properties":[{"id":"custom.width"},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"custom.align","value":"left"},{"id":"custom.inspect","value":true}] },
              { "matcher":{"id":"byRegexp","options":"/vsz|rss/"},"properties":[{"id":"unit","value":"decbytes"}]                                                                                                                    },
              { "matcher":{"id":"byRegexp","options":"/cpu|mem/"},"properties":[{"id":"unit","value":"percent"}]                                                                                                                     }
            ]
          },
          "gridPos":{"h":15,"w":24,"x":0,"y":295},
          "id":162,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"cpu"}]},
          "pluginVersion":"11.6.0",
          "targets":[{"datasource":{"type":"postgres","uid":"${dsn}"},"editorMode":"code","format":"table","rawQuery":true,"rawSql":"SELECT * FROM process_status;\n-- WHERE name = '${cls}';","refId":"A","sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50}}],
          "title":"Process Status",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{"bk_start_ts":true,"bk_stop_ts":true,"clonefrom":false,"nofailover":false,"noloadbalance":false,"nosync":false,"replicatefrom":false},
                "indexByName":{"clonefrom":10,"host":2,"lag":6,"name":1,"nofailover":9,"noloadbalance":11,"nosync":12,"port":3,"replicatefrom":8,"role":0,"state":4,"tags":13,"timeline":5,"url":7},
                "renameByName":{
                  "bk_annotation":"Annotation",
                  "bk_delta":"Delta",
                  "bk_error":"Error",
                  "bk_label":"Label",
                  "bk_prior":"Prior",
                  "bk_reference":"Reference",
                  "bk_repo_delta":"RepoDelta",
                  "bk_repo_size":"RepoSize",
                  "bk_size":"Size",
                  "bk_start_at":"StartAt",
                  "bk_start_lsn":"StartLSN",
                  "bk_start_ts":"StartTs",
                  "bk_stop_at":"StopAt",
                  "bk_stop_lsn":"StopLSN",
                  "bk_stop_ts":"StopTs",
                  "bk_type":"Type",
                  "clonefrom":"CloneFrom",
                  "host":"Host",
                  "lag":"Lag",
                  "name":"Cluster",
                  "nofailover":"NoFailover",
                  "noloadbalance":"NoLoadbalance",
                  "nosync":"NoSync",
                  "port":"Port",
                  "replicatefrom":"ReplicateFrom",
                  "role":"Role",
                  "start":"",
                  "stat":"",
                  "state":"State",
                  "tags":"Tags",
                  "timeline":"Timeline",
                  "url":"URL",
                  "wal_max":"max(WAL)",
                  "wal_min":"min(WAL)"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Process",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":41},
      "id":169,
      "panels":[
        {
          "datasource":{"type":"postgres","uid":"${dsn}"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
            "overrides":[
              { "matcher":{"id":"byRegexp","options":"/FS.*/"}             ,"properties":[{"id":"unit","value":"decmbytes"},{"id":"custom.width","value":120}] },{ "matcher":{"id":"byName","options":"Space%"}               ,"properties":[{"id":"custom.width","value":80}]                                    },
              { "matcher":{"id":"byRegexp","options":"/iNode|iUsed/iFree/"},"properties":[{"id":"unit","value":"short"},{"id":"custom.width","value":120}]     },{ "matcher":{"id":"byName","options":"Type"}                 ,"properties":[{"id":"custom.width","value":120}]                                   },
              { "matcher":{"id":"byName","options":"Name"}                 ,"properties":[{"id":"custom.minWidth","value":150}]                                },{ "matcher":{"id":"byName","options":"Mountpoint"}           ,"properties":[{"id":"custom.width","value":180}]                                   },
              { "matcher":{"id":"byName","options":"iNode%"}               ,"properties":[{"id":"custom.width","value":100}]                                   },{ "matcher":{"id":"byName","options":"iUsed"}                ,"properties":[{"id":"custom.width","value":111}]                                   },
              { "matcher":{"id":"byName","options":"iFree"}                ,"properties":[{"id":"custom.width","value":127}]                                   }
            ]
          },
          "gridPos":{"h":9,"w":24,"x":0,"y":311},
          "id":167,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[]},
          "pluginVersion":"11.6.0",
          "targets":[{"datasource":{"type":"postgres","uid":"${dsn}"},"editorMode":"code","format":"table","rawQuery":true,"rawSql":"SELECT * FROM disk_free;","refId":"A","sql":{"columns":[{"parameters":[],"type":"function"}],"groupBy":[{"property":{"type":"string"},"type":"groupBy"}],"limit":50}}],
          "title":"Disk Free",
          "transformations":[
            {
              "id":"organize",
              "options":{
                "excludeByName":{"bk_start_ts":true,"bk_stop_ts":true,"clonefrom":false,"nofailover":false,"noloadbalance":false,"nosync":false,"replicatefrom":false},
                "indexByName":{"avail_1m":5,"fsname":0,"fstype":1,"ifree":9,"ipercent":10,"itotal":7,"iused":8,"mountpoint":2,"percent":6,"total_1m":3,"used_1m":4},
                "renameByName":{
                  "avail_1m":"FS Avail",
                  "bk_annotation":"Annotation",
                  "bk_delta":"Delta",
                  "bk_error":"Error",
                  "bk_label":"Label",
                  "bk_prior":"Prior",
                  "bk_reference":"Reference",
                  "bk_repo_delta":"RepoDelta",
                  "bk_repo_size":"RepoSize",
                  "bk_size":"Size",
                  "bk_start_at":"StartAt",
                  "bk_start_lsn":"StartLSN",
                  "bk_start_ts":"StartTs",
                  "bk_stop_at":"StopAt",
                  "bk_stop_lsn":"StopLSN",
                  "bk_stop_ts":"StopTs",
                  "bk_type":"Type",
                  "blocks_1m":"Blocks (1MB)",
                  "clonefrom":"CloneFrom",
                  "file_system":"FileSystem",
                  "fsname":"Name",
                  "fstype":"Type",
                  "host":"Host",
                  "ifree":"iFree",
                  "ipercent":"iNode%",
                  "itotal":"iNode",
                  "iused":"iUsed",
                  "lag":"Lag",
                  "mounted_on":"MountPoint",
                  "mountpoint":"Mountpoint",
                  "name":"Cluster",
                  "nofailover":"NoFailover",
                  "noloadbalance":"NoLoadbalance",
                  "nosync":"NoSync",
                  "percent":"Space%",
                  "port":"Port",
                  "replicatefrom":"ReplicateFrom",
                  "role":"Role",
                  "start":"",
                  "stat":"",
                  "state":"State",
                  "tags":"Tags",
                  "timeline":"Timeline",
                  "total_1m":"FS Size",
                  "url":"URL",
                  "used_1m":"FS Used",
                  "wal_max":"max(WAL)",
                  "wal_min":"min(WAL)"
                }
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Disk Free",
      "type":"row"
    }
  ],
  "preload":false,
  "refresh":"",
  "schemaVersion":41,
  "tags":["Pigsty","PGSQL","PGCAT","Instance"],
  "templating":{
    "list":[
      {"current":{},"description":"Database Instance","includeAll":false,"label":"Data Source","name":"dsn","options":[],"query":"postgres","refresh":1,"regex":"/.*\\..*/","type":"datasource"},
      {"current":{},"datasource":{"type":"postgres","uid":"${dsn}"},"definition":"SELECT '${dsn:text}';","description":"Instance","hide":2,"includeAll":false,"label":"Instance","name":"ins","options":[],"query":"SELECT '${dsn:text}';","refresh":2,"regex":"/(\\S+)\\.\\S+/","sort":1,"type":"query"},
      {"current":{},"datasource":{"type":"postgres","uid":"${dsn}"},"definition":"SELECT '${dsn:text}';","description":"Database name of this table","hide":2,"includeAll":false,"label":"Database","name":"datname","options":[],"query":"SELECT '${dsn:text}';","refresh":1,"regex":"/\\S+\\.(\\S+)/","type":"query"},
      {"current":{},"datasource":{"type":"postgres","uid":"${dsn}"},"definition":"SELECT '${dsn:text}';","description":"Cluster","hide":2,"includeAll":false,"label":"Cluster","name":"cls","options":[],"query":"SELECT '${dsn:text}';","refresh":2,"regex":"/(\\S+)-\\d+\\.\\S+/","sort":1,"type":"query"},
      {"current":{},"datasource":{"type":"prometheus","uid":"ds-prometheus"},"definition":"label_values(pg_up{ins=\"$ins\"} ,ip)","description":"Node IP address","hide":2,"includeAll":false,"label":"IP","name":"ip","options":[],"query":{"query":"label_values(pg_up{ins=\"$ins\"} ,ip)","refId":"PrometheusVariableQueryEditor-VariableQuery"},"refresh":2,"regex":"","sort":1,"type":"query"},
      {
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(node_uname_info{ip=\"$ip\"},nodename)",
        "description":"Node name",
        "hide":2,
        "includeAll":false,
        "label":"Node",
        "name":"node",
        "options":[],
        "query":{"query":"label_values(node_uname_info{ip=\"$ip\"},nodename)","refId":"PrometheusVariableQueryEditor-VariableQuery"},
        "refresh":2,
        "regex":"",
        "sort":1,
        "type":"query"
      }
    ]
  },
  "time":{"from":"now-1h","to":"now"},
  "timepicker":{"refresh_intervals":["100ms","200ms","300ms","500ms","1s","2s","3s","5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"]},
  "timezone":"browser",
  "title":"PGCAT Instance",
  "uid":"pgcat-instance",
  "version":1
}