{
  "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 Instance Dashboard",
  "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":62,"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","value":0}]}},
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"links","value":[{"title":"PGCAT Instance : ${ins}","url":"/d/pgcat-instance?var-dsn=${ins}.postgres&${__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":132,
      "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.3.1",
      "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" }
      ],
      "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"},"footer":{"reducers":[]},"inspect":false},"mappings":[],"max":1.2,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0","value":0}]}},
        "overrides":[
          {"matcher":{"id":"byName","options":"Instance"},"properties":[{"id":"links","value":[{"title":"PGSQL Instance ${__data.fields.Instance}","url":"/d/pgsql-instance?var-ins=${__data.fields.Instance}&${__url_time_range}"}]},{"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","value":0},{"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","value":0},{"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","value":0},{"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","value":0},{"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","value":0},{"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":"LB Conn"},"properties":[{"id":"custom.width","value":72},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"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","value":0},{"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":14,"x":6,"y":1},
      "id":109,
      "links":[{"title":"PGSQL Instance : ${primary}","url":"/d/pgsql-instance?var-ins=${primary}&${__url_time_range}"}],
      "options":{"cellHeight":"sm","showHeader":true,"sortBy":[{"desc":false,"displayName":"Instance"}]},
      "pluginVersion":"12.3.1",
      "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":"max by (ins) (pg:ins:load1{cls=\"$cls\"})"                                               ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (ins) (pg:ins:xact_total_rate1m{cls=\"$cls\"})"                                   ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins,ip) (pg_in_recovery{cls=\"$cls\"})"                                          ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (ins) (pg:ins:num_backends{cls=\"$cls\"})"                                        ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (ins,instance) (haproxy_backend_current_sessions{cls=\"$cls\", proxy!=\"stats\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"G" }
      ],
      "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":9,"Time 2":10,"Time 3":11,"Time 4":12,"Time 5":13,"Time 6":15,"Value #A":0,"Value #B":4,"Value #C":5,"Value #D":1,"Value #E":7,"Value #G":6,"ins":2,"instance":8,"ip 1":3,"ip 2":14},
            "renameByName":{"Time 4":"","Value #A":"Up","Value #B":"Load","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":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"footer":{"reducers":[]},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0","value":0}]}},
        "overrides":[
          {
            "matcher":{"id":"byName","options":"Database"},
            "properties":[
              { "id":"links"             ,"value":[{"title":"PGSQL Database : ${cls}.${__data.fields.Database}","url":"/d/pgsql-database?var-ins=${ins}&var-datname=${__data.fields.Database}&${__url_time_range}"}] },
              { "id":"mappings"          ,"value":[{"options":{"postgres":{"color":"#808080","index":2},"template0":{"color":"#c0c0c0e0","index":0},"template1":{"color":"#a8a8a8e0","index":1}},"type":"value"}]    },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                              },
              { "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                            },
              { "id":"filterable"                                                                                                                                                                                    },
              { "id":"custom.minWidth"   ,"value":120                                                                                                                                                                }
            ]
          },{
            "matcher":{"id":"byName","options":"OID"},
            "properties":[
              { "id":"links"             ,"value":[{"title":"PGCAT Database : ${ins}.${__data.fields.Database}","url":"/d/pgcat-database?var-dsn=${ins}.${__data.fields.Database}"}] },{ "id":"mappings"          ,"value":[{"options":{"from":0,"result":{"color":"#bfbfbf4d","index":0},"to":10},"type":"range"}]                                           },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                              },{ "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]}                                                                        },
              { "id":"custom.width"      ,"value":90                                                                                                                                 }
            ]
          }
        ]
      },
      "gridPos":{"h":6,"w":4,"x":20,"y":1},
      "id":122,
      "options":{"cellHeight":"sm","showHeader":true,"sortBy":[{"desc":true,"displayName":"OID"}]},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (datname) (pg_db_datid{ins=\"$ins\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"OID","refId":"O"}],
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"datname"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Time 1":true,"Time 10":true,"Time 11":true,"Time 12":true,"Time 13":true,"Time 14":true,"Time 15":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,"Value #G":false,"Value #H":false,"host":true},
            "indexByName":{
              "Time 1":17,
              "Time 10":26,
              "Time 11":27,
              "Time 12":28,
              "Time 13":29,
              "Time 14":30,
              "Time 15":31,
              "Time 2":18,
              "Time 3":19,
              "Time 4":20,
              "Time 5":21,
              "Time 6":22,
              "Time 7":23,
              "Time 8":24,
              "Time 9":25,
              "Value #A":2,
              "Value #B":3,
              "Value #C":15,
              "Value #D":4,
              "Value #E":5,
              "Value #F":11,
              "Value #G":6,
              "Value #H":10,
              "Value #I":13,
              "Value #J":14,
              "Value #K":12,
              "Value #L":9,
              "Value #M":8,
              "Value #N":7,
              "Value #O":1,
              "datname":0,
              "host":16
            },
            "renameByName":{"Time 1":"","Time 7":"","Value":"OID","Value #A":"Size","Value #B":"Age","Value #C":"T","Value #D":"Backend","Value #E":"TPS","Value #F":"ConnLimit","Value #G":"RT","Value #H":"Conn%","Value #I":"D","Value #J":"P","Value #K":"PoolSize","Value #L":"Load","Value #M":"Client","Value #N":"Server","Value #O":"OID","datname":"Database","host":"Target","real_datname":"Datname"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[],"mappings":[{"options":{"0":{"color":"#cc4637d9","index":1,"text":"Dead"},"1":{"color":"#346f36cc","index":2,"text":"Up"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":0}},"type":"special"}],"max":1.1,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#aaaaaa","value":1}]}},
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"}       ,"properties":[{"id":"links","value":[{"title":"PGCAT Instance : ${ins}.postgres","url":"/d/pgcat-instance?var-dsn=${ins}.postgres&${__url_time_range}"}]}]             },
          { "matcher":{"id":"byFrameRefID","options":"B"}       ,"properties":[{"id":"links","value":[{"title":"PGSQL Pgbouncer : ${ins}","url":"/d/pgsql-pgbouncer?var-ins=${ins}&${__url_time_range}"}]}]                             },
          { "matcher":{"id":"byFrameRefID","options":"F"}       ,"properties":[{"id":"links","value":[{"title":"Node Instance : ${ip}","url":"/d/node-instance?var-id=${ip}&${__url_time_range}"}]}]                                    },
          { "matcher":{"id":"byRegexp","options":"/.*exporter/"},"properties":[{"id":"links","value":[{"title":"PGSQL Exporter : ${__field.labels.ins}","url":"/d/pgsql-exporter?var-ins=${__field.labels.ins}&${__url_time_range}"}]}] },
          { "matcher":{"id":"byName","options":"patroni"}       ,"properties":[{"id":"links","value":[{"title":"PGSQL Patroni : ${cls}","url":"/d/pgsql-patroni?var-cls=${cls}&${__url_time_range}"}]}]                                 },
          { "matcher":{"id":"byName","options":"pgbackrest"}    ,"properties":[{"id":"links","value":[{"title":"PGSQL Backup : ${__field.labels.cls}","url":"/d/pgsql-pitr?var-cls=${__field.labels.cls}&${__url_time_range}"}]}]       }
        ]
      },
      "gridPos":{"h":7,"w":4,"x":0,"y":7},
      "id":112,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":12},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_up{ins=\"$ins\"}"                        ,"hide":false,"instant":true,"interval":"","legendFormat":"postgres"    ,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pgbouncer_up{ins=\"$ins\"}"                 ,"hide":false,"instant":true,"interval":"","legendFormat":"pgbouncer"   ,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_up{ins=\"$ins\"}"                   ,"hide":false,"instant":true,"interval":"","legendFormat":"patroni"     ,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" pg_exporter_agent_up{ins=\"$ins\"}"        ,"hide":false,"instant":true,"interval":"","legendFormat":"pg_exporter" ,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" pgbouncer_exporter_agent_up{ins=\"$ins\"}" ,"hide":false,"instant":true,"interval":"","legendFormat":"pgb_exporter","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" pgbackrest_exporter_agent_up{ins=\"$ins\"}","hide":false,"instant":true,"interval":"","legendFormat":"pgbackrest"  ,"refId":"S" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" node_up{ip=~\"$ip\"}"                      ,"hide":false,"instant":true,"interval":"","legendFormat":"node"        ,"refId":"F" }
      ],
      "title":"Aliveness",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[{"title":"PGCAT Instance : ${ins}","url":"/d/pgcat-instance?var-dsn=${ins}.postgres&${__url_time_range}"}],"mappings":[{"options":{"match":"null+nan","result":{"color":"transparent","index":1}},"type":"special"}],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]}},
        "overrides":[
          { "matcher":{"id":"byName","options":"WAL Paused"} ,"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Running"},"1":{"color":"#f79f64","index":1,"text":"Paused"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}] },
          { "matcher":{"id":"byName","options":"WAL"}        ,"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Proceed"},"1":{"color":"#f79f64","index":1,"text":"Paused"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}] },
          { "matcher":{"id":"byName","options":"PG Uptime"}  ,"properties":[{"id":"unit","value":"s"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#cc4637d9","value":0},{"color":"#f79f64","value":300},{"color":"#fcdb72","value":3600},{"color":"#346f36cc","value":86400}]}}]                                     },
          { "matcher":{"id":"byName","options":"Alive"}      ,"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#cc4637d9","index":0,"text":"Dead"},"1":{"color":"#346f36cc","index":1,"text":"Alive"}},"type":"value"}]}]                                                                                                },
          { "matcher":{"id":"byName","options":"Last Reload"},"properties":[{"id":"unit","value":"s"}]                                                                                                                                                                                                                                    }
        ]
      },
      "gridPos":{"h":7,"w":4,"x":4,"y":7},
      "id":121,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12},"textMode":"auto","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_up{ins=\"$ins\"}"                  ,"format":"table",             "instant":true,"legendFormat":"__auto","range":false,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_uptime{ins=\"$ins\"}"              ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_version{ins=\"$ins\"}"             ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_conf_reload_time{ins=\"$ins\"}"    ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:timeline{ins=\"$ins\"}"        ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_is_wal_replay_paused{ins=\"$ins\"}","format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"F" }
      ],
      "title":"Postgres",
      "transformations":[
        {"id":"joinByField","options":{"byField":"ins","mode":"outer"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Time 1":true,"Time 10":true,"Time 11":true,"Time 12":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,"Value #C":false,"Value #E":false,"Value #H":true,"Value #I":true,"Value #K":true,"__name__ 1":false,"cls":true,"ins":true,"scope":false},
            "indexByName":{
              "Time 1":6,
              "Time 2":7,
              "Time 3":8,
              "Time 4":9,
              "Time 5":10,
              "Time 6":11,
              "Value #A":0,
              "Value #B":2,
              "Value #C":5,
              "Value #D":3,
              "Value #E":4,
              "Value #F":1,
              "__name__ 1":12,
              "__name__ 2":18,
              "__name__ 3":23,
              "__name__ 4":28,
              "__name__ 5":33,
              "__name__ 6":38,
              "cls 1":14,
              "cls 2":19,
              "cls 3":24,
              "cls 4":29,
              "cls 5":34,
              "cls 6":39,
              "ins":13,
              "instance 1":15,
              "instance 2":20,
              "instance 3":25,
              "instance 4":30,
              "instance 5":35,
              "instance 6":40,
              "ip 1":16,
              "ip 2":21,
              "ip 3":26,
              "ip 4":31,
              "ip 5":36,
              "ip 6":41,
              "job 1":17,
              "job 2":22,
              "job 3":27,
              "job 4":32,
              "job 5":37,
              "job 6":42
            },
            "renameByName":{"Value #A":"Alive","Value #B":"PG Uptime","Value #C":"Version","Value #D":"Last Reload","Value #E":"Timeline","Value #F":"WAL Paused","Value #G":"","Value #H":"","Value #I":"","Value #J":"","Value #K":"","Value #L":"Up","cls":"Cluster","ins":"Instance","scope":"Shard"}
          }
        }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "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","value":0}]}},
        "overrides":[
          {"matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#f79f64","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","value":0},{"color":"#346f36cc","value":1}]}}]},
          {
            "matcher":{"id":"byFrameRefID","options":"D"},
            "properties":[
              { "id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]}                                                                                 },{ "id":"mappings"  ,"value":[{"options":{"0":{"color":"#f79f64","index":0,"text":"Leading"},"1":{"color":"#3e668f","index":1,"text":"Follow"}},"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","value":0},{"color":"#346f36cc","value":1}]}}]},{"matcher":{"id":"byFrameRefID","options":"F"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":1}]}}]}
        ]
      },
      "gridPos":{"h":7,"w":4,"x":8,"y":7},
      "id":31,
      "links":[{"title":"PGSQL Replication : ${cls}","url":"/d/pgsql-replication?var-cls=${cls}&${__url_time_range}"}],
      "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":"12.3.1",
      "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"},"editorMode":"code","exemplar":false,"expr":"(pg_recv_init_lsn{ins=\"$ins\"} > bool 0) or on() vector(0)"             ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ sender_host }} ","queryType":"measurements","refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"count(pg_repl_lsn{ins=\"$ins\"}) or on() vector(0)"                      ,"hide":false,"instant":true,"interval":"","legendFormat":"Downstream"        ,"queryType":"measurements","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_sync_standby_enabled{ins=\"$ins\"}"                                   ,"hide":false,"instant":true,"interval":"","legendFormat":"Sync Commit"       ,"queryType":"measurements","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"count by (ins)(pg_pubrel_count{ins=\"$ins\"}) > bool 0 or on() vector(0)","hide":false,"instant":true,"interval":"","legendFormat":"Publication"       ,"queryType":"measurements","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"count by (ins)(pg_sub_id{ins=\"$ins\"}) or on() vector(0)"               ,"hide":false,"instant":true,"interval":"","legendFormat":"Subscription"      ,"queryType":"measurements","refId":"F" }
      ],
      "title":"Replication",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"HA Agent - Patroni Metrics",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[{"title":"PGSQL Patroni : ${cls}","url":"/d/pgsql-patroni?var-cls=${cls}&${__url_time_range}"}],"mappings":[{"options":{"match":"null+nan","result":{"color":"transparent","index":1}},"type":"special"}],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]}},
        "overrides":[
          { "matcher":{"id":"byName","options":"Instance"},"properties":[{"id":"links","value":[{"title":"PGSQL Instance: ${__data.fields.Instance}","url":"/d/pgsql-instance?var-ins=${__data.fields.Instance}&${__url_time_range}"}]}]                                                                                                                                                                       },
          { "matcher":{"id":"byName","options":"Shard"}   ,"properties":[{"id":"links","value":[{"title":"PGSQL Shard : ${__data.fields.Shard}","url":"/d/pgsql-shard?var-shard=${__data.fields.Shard}&${__url_time_range}"}]}]                                                                                                                                                                                },
          { "matcher":{"id":"byName","options":"HA Role"} ,"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Replica"},"1":{"color":"#f79f64","index":1,"text":"Primary"},"2":{"color":"#3e668f","index":2,"text":"Standby Leader"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"#808080","index":3,"text":"Unknown"}},"type":"special"}]}] },
          { "matcher":{"id":"byName","options":"Maintain"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Resumed"},"1":{"color":"#f79f64","index":1,"text":"Paused"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]                                                                         },
          { "matcher":{"id":"byName","options":"Unlocked"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Unlock"},"1":{"color":"#f79f64","index":1,"text":"Locked"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]                                                                          },
          { "matcher":{"id":"byName","options":"Restart"} ,"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"No Need"},"1":{"color":"#f79f64","index":1,"text":"Pending"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]                                                                        },
          { "matcher":{"id":"byName","options":"Failsafe"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Inactive"},"1":{"color":"#cc4637d9","index":1,"text":"Active"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]                                                                      },
          { "matcher":{"id":"byName","options":"WAL"}     ,"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Proceed"},"1":{"color":"#f79f64","index":1,"text":"Paused"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]                                                                         },
          { "matcher":{"id":"byName","options":"DCS Seen"},"properties":[{"id":"unit","value":"s"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#f79f64","value":20},{"color":"#cc4637d9","value":30},{"color":"#b783af","value":60},{"color":"text","value":300}]}}]                                                                                      }
        ]
      },
      "gridPos":{"h":7,"w":4,"x":12,"y":7},
      "id":119,
      "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":"auto","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_primary{ins=\"$ins\"} + patroni_standby_leader{ins=\"$ins\"}","format":"table",             "instant":true,"legendFormat":"__auto","range":false,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_version{ins=\"$ins\"}"                                       ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_postgres_server_version{ins=\"$ins\"}"                       ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_is_paused{ins=\"$ins\"}"                                     ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_pending_restart{ins=\"$ins\"}"                               ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"F" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_failsafe_mode_is_active{ins=\"$ins\"}"                       ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"G" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"time() - patroni_dcs_last_seen{ins=\"$ins\"}"                        ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"J" }
      ],
      "title":"HA Status",
      "transformations":[
        {"id":"joinByField","options":{"byField":"ins","mode":"outer"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Time 1":true,"Time 10":true,"Time 11":true,"Time 12":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,"Value #C":true,"Value #E":true,"Value #H":true,"Value #I":true,"Value #K":true,"__name__ 1":false,"cls":true,"ins":true,"scope":false},
            "indexByName":{"Time 1":15,"Time 10":24,"Time 11":25,"Time 12":26,"Time 2":16,"Time 3":17,"Time 4":18,"Time 5":19,"Time 6":20,"Time 7":21,"Time 8":22,"Time 9":23,"Value #A":1,"Value #B":13,"Value #C":14,"Value #D":6,"Value #E":7,"Value #F":8,"Value #G":9,"Value #H":10,"Value #I":11,"Value #J":5,"Value #K":12,"Value #L":0,"cls":3,"ins":2,"scope":4},
            "renameByName":{"Value #A":"HA Role","Value #B":"Version","Value #C":"PG Ver","Value #D":"Maintain","Value #E":"Unlocked","Value #F":"Restart","Value #G":"Failsafe","Value #H":"WAL","Value #I":"Postgres","Value #J":"DCS Seen","Value #K":"PG Uptime ","Value #L":"Up","cls":"Cluster","ins":"Instance","scope":"Shard"}
          }
        }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"The number of proxies that serve corresponding service and have route to this ${ins} server.\n\nClick goes to PGSQL Service Dashboard",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Service for ${__field.labels.proxy}","url":"/d/pgsql-service?var-svc=${__field.labels.proxy}&${__url_time_range}"}],
          "mappings":[{"options":{"0":{"color":"#808080","index":1,"text":"Nil"},"1":{"color":"#346f36cc","index":2,"text":"OK"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"#808080","index":0,"text":"N/A"}},"type":"special"}],
          "thresholds":{"mode":"absolute","steps":[{"color":"#cc4637d9","value":0},{"color":"#3e668f","value":1},{"color":"#346f36cc","value":2}]},
          "unit":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":4,"x":16,"y":7},
      "id":115,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (proxy) (haproxy_server_status{proxy=~\"$cls.*\", server=\"$ins\", state=\"UP\"})","interval":"","legendFormat":"{{ proxy }}","range":true,"refId":"A"}],
      "title":"Service",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"TPS (1m) of each database on this postgres server",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Database : ${__field.labels.datname}","url":"/d/pgsql-database?var-ins=${ins}&var-datname=${__field.labels.datname}&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"red","index":0,"text":"Unavailable"}},"type":"special"}],
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":10},{"color":"#f79f64","value":20000},{"color":"red","value":40000},{"color":"#b783af","value":80000}]},
          "unit":"reqps"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":4,"x":20,"y":7},
      "id":124,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (datname) (rate(pg_db_xact_total{ins=\"$ins\", datname!~'template\\\\d'}[1m]))","interval":"","legendFormat":"{{ proxy }}","range":true,"refId":"A"}],
      "title":"Database",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":2,
          "links":[{"title":"PGSQL Instance : Pressure for ${__field.labels.ins}","url":"/d/pgsql-instance?var-ins=${__field.labels.ins}&viewPanel=38&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"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}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":0,"y":14},
      "id":40,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"ins:pressure1{ins=\"$ins\"}","interval":"","legendFormat":"PG LOAD","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":2,
          "links":[{"title":"PGSQL Instance : Pressure for ${__field.labels.ins}","url":"/d/pgsql-instance?var-ins=${__field.labels.ins}&viewPanel=72&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"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}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":3,"y":14},
      "id":114,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"node:ins:cpu_usage{ip=\"$ip\"}","interval":"","legendFormat":"CPU","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Xacts : Transaction Commit for ${ins}","url":"/d/pgsql-xacts?var-ins=${ins}&viewPanel=98&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#f79f64","value":32000}]},
          "unit":"none"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":6,"y":14},
      "id":46,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":32},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"exemplar":false,"expr":"pg:ins:xact_commit_rate1m{ins=\"$ins\"}","interval":"","legendFormat":"Commit","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Xacts : Transaction Rollback for ${ins}","url":"/d/pgsql-xacts?var-ins=${ins}&viewPanel=99&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"#808080","index":0,"text":"\u2205"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#f79f64","value":0.01}]},
          "unit":"none"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":9,"y":14},
      "id":108,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":32},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:xact_rollback_rate1m{ins=\"$ins\"}","interval":"","legendFormat":"Rollback","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Replication : ${ins}","url":"/d/pgsql-replication?var-cls=${cls}&viewPanel=92&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":1024},{"color":"#fcdb72","value":64000000},{"color":"#f79f64","value":128000000},{"color":"#cc4637d9","value":256000000},{"color":"#b783af","value":512000000},{"color":"text","value":1024000000}]},
          "unit":"binBps"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":12,"y":14},
      "id":107,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":32},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:lsn_rate1m{ins=\"$ins\"}","interval":"","legendFormat":"LSN Rate","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Session : ${ins}","url":"/d/pgsql-session?var-ins=${ins}&viewPanel=111&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":0.1},{"color":"#fcdb72","value":0.3},{"color":"#f79f64","value":0.5},{"color":"#cc4637d9","value":0.7},{"color":"#b783af","value":0.9},{"color":"text","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":15,"y":14},
      "id":106,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":32},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum without(datname) (pg_db_numbackends{ins=\"$ins\"}) / pg_setting_max_connections{ins=\"$ins\"}","interval":"","legendFormat":"Conn%","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Replication for Cluster ${cls}","url":"/d/pgsql-replication?var-cls=${cls}&viewPanel=74&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#fcdb72","value":0.1},{"color":"#f79f64","value":1},{"color":"#cc4637d9","value":4},{"color":"#b783af","value":16},{"color":"text","value":64}]},
          "unit":"s"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":18,"y":14},
      "id":48,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":32},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"exemplar":false,"expr":"max by (cls,ins)(pg_repl_replay_lag{ins=\"$ins\"} or pg:ins:lag_seconds{ins=\"$ins\"} or pg_lag{ins=\"$ins\"})","interval":"","legendFormat":"Lag","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL FS Space Usage for ${ip}","url":"/d/node-instance?var-id=${ip}&viewPanel=199&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#f79f64","value":0.8},{"color":"#cc4637d9","value":0.9},{"color":"#b783af","value":0.95},{"color":"text","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":4,"w":3,"x":21,"y":14},
      "id":49,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"node:fs:space_usage{ip=\"$ip\"}","interval":"","legendFormat":"Space: {{ mountpoint }}","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":1,
          "links":[],
          "mappings":[{"options":{"-1":{"color":"#808080","index":1,"text":"N/A"}},"type":"value"}],
          "max":1.1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":0.1},{"color":"#EAB839","value":0.3},{"color":"#f79f64","value":0.5},{"color":"red","value":0.7},{"color":"#b783af","value":0.9},{"color":"text","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"Haproxy"}  ,"properties":[{"id":"links","value":[{"title":"Node HAProxy : ${ins}","url":"/d/node-haproxy?var-ins=${node_ins}&${__url_time_range}"}]}]  },{ "matcher":{"id":"byName","options":"Node"}     ,"properties":[{"id":"links","value":[{"title":"PGSQL Node : ${ins}@${ip}","url":"/d/node-instance?var-id=${ip}&${__url_time_range}"}]}]    },
          { "matcher":{"id":"byName","options":"Postgres"} ,"properties":[{"id":"links","value":[{"title":"PGRDS Instance : ${ins}","url":"/d/pgrds-instance?var-ins=${ins}&${__url_time_range}"}]}]   },{ "matcher":{"id":"byName","options":"Pgbouncer"},"properties":[{"id":"links","value":[{"title":"PGSQL Pgbouncer : ${ins}","url":"/d/pgsql-pgbouncer?var-ins=${ins}&${__url_time_range}"}]}] },
          { "matcher":{"id":"byName","options":"Exporter"} ,"properties":[{"id":"links","value":[{"title":"PGSQL Exporter : ${ins}","url":"/d/pgsql-exporter?var-ins=${ins}&${__url_time_range}"}]}]   }
        ]
      },
      "gridPos":{"h":5,"w":3,"x":0,"y":18},
      "id":123,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"auto","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:cls:load1{cls=\"$cls\"}"                            ,             "interval":"","legendFormat":"Postgres" ,"range":true,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pgbouncer:cls:load1{cls=\"$cls\"}"                     ,"hide":false,"interval":"","legendFormat":"Pgbouncer","range":true,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum(rate(process_cpu_seconds_total{cls=\"$cls\"}[1m]))","hide":false,"interval":"","legendFormat":"Exporter" ,"range":true,"refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"avg by (cls) (haproxy:ins:usage{ip=~\"$ip\"})"         ,"hide":false,"interval":"","legendFormat":"Haproxy"  ,"range":true,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"pg:cls:cpu_usage{cls=\"$cls\"}"                        ,"hide":false,"interval":"","legendFormat":"Node"     ,             "refId":"C" }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Overall pressure for this PostgreSQL Node and Instance. \nmax(node:ins:cpu_usage, pg:ins:load, pgbouncer:ins:load)",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"none",
            "hideFrom":{"graph":false,"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineStyle":{"fill":"solid"},
            "lineWidth":2,
            "pointSize":3,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"auto",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"area"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"green","value":0},{"color":"red","value":0.7},{"color":"purple","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":5,"w":9,"x":3,"y":18},
      "id":38,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":false},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:load1{ins=\"$ins\"}" ,             "interval":"","legendFormat":"p1" ,"range":true,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:load5{ins=\"$ins\"}" ,"hide":false,"interval":"","legendFormat":"p5" ,"range":true,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:load15{ins=\"$ins\"}","hide":false,"interval":"","legendFormat":"p15","range":true,"refId":"C" }
      ],
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Alerting event graph. Each stripe represent an alerting Event. Gray transparent stipe are pending alerts.",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"hidden",
            "axisSoftMax":1.2,
            "axisSoftMin":0,
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":98,
            "gradientMode":"none",
            "hideFrom":{"graph":false,"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"stepBefore",
            "lineWidth":0,
            "pointSize":1,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "decimals":0,
          "links":[
            { "targetBlank":true,"title":"AlertInfo ${__field.labels.alertname} on Instance ${ins}","url":"/alertmgr/#/alerts?filter=%7Bins%3D%22${ins}%22%2C%20alertname%3D%22${__field.labels.alertname}%22%7D"       },
            { "targetBlank":true,"title":"Silence ${__field.labels.alertname} on Cluster ${ins}"   ,"url":"/alertmgr/#/silences/new?filter=%7Bins%3D%22${ins}%22%2C%20alertname%3D%22${__field.labels.alertname}%22%7D" },
            {                    "title":"PGSQL Cluster for ${__field.labels.cls} : Alerts"        ,"url":"/d/pgsql-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"                                          },
            {                    "title":"PGSQL Node for ${__field.labels.ins}"                    ,"url":"/d/node-instance?var-ins=${__field.labels.ins}&${__url_time_range}"                                          }
          ],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"none"
        },
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"custom.fillOpacity","value":66},{"id":"mappings","value":[{"options":{"1":{"index":0,"text":"Firing\ud83d\udd25"}},"type":"value"}]}]                                                                                        },
          { "matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"custom.fillOpacity","value":25},{"id":"color","value":{"fixedColor":"rgba(128, 128, 128, 0.5)","mode":"fixed"}},{"id":"mappings","value":[{"options":{"1":{"color":"gray","index":0,"text":"Pend\u23f0"}},"type":"value"}]}] },
          { "matcher":{"id":"byType","options":"time"}   ,"properties":[{"id":"custom.axisPlacement","value":"auto"}]                                                                                                                                                                                       }
        ]
      },
      "gridPos":{"h":5,"w":12,"x":12,"y":18},
      "id":54,
      "options":{"legend":{"calcs":["last"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "exemplar":false,"expr":"ALERTS{ins=\"$ins\", alertstate=\"firing\"}"  ,             "interval":"","legendFormat":"[{{ severity }}\ud83d\udd25] {{alertname}}","refId":"A" },{ "exemplar":false,"expr":"ALERTS{ins=\"$ins\", alertstate=\"pending\"} ","hide":false,"interval":"","legendFormat":"[{{ severity }}\u23f0] {{alertname}}"      ,"refId":"B" },
        { "exemplar":false,"expr":"0"                                            ,"hide":true ,"interval":"","legendFormat":"Alert"                                     ,"refId":"C" }
      ],
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":23},"id":125,"panels":[],"title":"Member","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]},"unit":"string"},"overrides":[]},
      "gridPos":{"h":1,"w":24,"x":0,"y":24},
      "id":133,
      "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","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_meta_info{ins=\"$ins\"}","format":"table","instant":true,"interval":"","legendFormat":"","range":false,"refId":"A"}],
      "transformations":[{"id":"filterFieldsByName","options":{"include":{"pattern":"ver_str"}}},{"id":"organize","options":{"excludeByName":{},"includeByName":{},"indexByName":{},"renameByName":{"ver_str":"Version"}}}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Database of this cluster ${cls}\n\nLoad: active_time / backends (PG14 only)\n\nQuery RT : max query rt of this database\n\nClient: Pgbouncer Active Clients\n\nServer: Pgbouncer Active Servers\n\nBackend: Postgres num backends\n\nT = is Template?\n\nD = Disabled in Pgbouncer ?\n\nP = Paused in Pgbouncer ?",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"footer":{"reducers":[]},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0","value":0}]}},
        "overrides":[
          {
            "matcher":{"id":"byName","options":"Database"},
            "properties":[
              { "id":"links"             ,"value":[{"title":"PGSQL Cluster Database : ${cls}.${__data.fields.Database}","url":"/d/pgsql-databases?var-cls=${cls}&var-datname=${__data.fields.Database}&${__url_time_range}"}] },
              { "id":"mappings"          ,"value":[{"options":{"postgres":{"color":"#808080","index":2},"template0":{"color":"#c0c0c0e0","index":0},"template1":{"color":"#a8a8a8e0","index":1}},"type":"value"}]             },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                       },
              { "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                                     },
              { "id":"filterable"                                                                                                                                                                                             }
            ]
          },{
            "matcher":{"id":"byName","options":"Size"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                        },
              { "id":"unit"              ,"value":"decbytes"                                                                                                                                                                                },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":1000000000},{"color":"#fcdb72","value":1000000000000},{"color":"#f79f64","value":10000000000000}]} },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                     },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                     },
              { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                     },
              { "id":"decimals"          ,"value":0                                                                                                                                                                                         }
            ]
          },{
            "matcher":{"id":"byName","options":"Age"},
            "properties":[
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"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":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                                                                        },
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                                                                                },
              { "id":"custom.width"      ,"value":60                                                                                                                                                                                                                                                                                           },
              { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                                                                        },
              { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                                                                            }
            ]
          },
          {"matcher":{"id":"byName","options":"TPS"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#f79f64","value":30000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"custom.width","value":70},{"id":"color","value":{"mode":"thresholds"}},{"id":"decimals","value":1}]},
          {
            "matcher":{"id":"byName","options":"T"},
            "properties":[{"id":"custom.width","value":40},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":1,"text":"F"},"1":{"color":"#f79f64","index":2,"text":"T"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"#e3e3e3e0","index":0,"text":"N"}},"type":"special"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]
          },{
            "matcher":{"id":"byName","options":"Backend"},
            "properties":[{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":4},{"color":"#f79f64","value":1000}]}},{"id":"color","value":{"mode":"thresholds"}},{"id":"custom.width","value":75},{"id":"custom.cellOptions","value":{"type":"color-text"}}]
          },{
            "matcher":{"id":"byName","options":"ConnLimit"},
            "properties":[
              { "id":"custom.width"      ,"value":85                                                                                                                                                                                                                                                                                },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                                                             },
              { "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":"byRegexp","options":"Conn%"},
            "properties":[
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                                           },
              { "id":"custom.width"      ,"value":90                                                                                                                                                                                                                                                      },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"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":0.99}]} },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                                   }
            ]
          },
          {"matcher":{"id":"byName","options":"Client"},"properties":[{"id":"custom.width","value":60},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#fcdb72","value":1000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"Server"},"properties":[{"id":"custom.width","value":60},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":4},{"color":"#fcdb72","value":1000}]}}]},
          {"matcher":{"id":"byName","options":"Conn%"},"properties":[{"id":"custom.width","value":70},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"decimals","value":1}]},
          {
            "matcher":{"id":"byName","options":"RT"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                            },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#fcdb72","value":1},{"color":"#f79f64","value":2},{"color":"red","value":4},{"color":"#b783af","value":8},{"color":"text","value":16}]} },
              { "id":"mappings"          ,"value":[{"options":{"match":"null+nan","result":{"index":0,"text":"-"}},"type":"special"}]                                                                                                                           },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                         },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                                           }
            ]
          },{
            "matcher":{"id":"byName","options":"Load"},
            "properties":[
              { "id":"custom.width"      ,"value":120                                                                                                                                                                                                                                                  },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"gauge"}                                                                                                                                                                                                                   },
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                                        },
              { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                                    },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"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":"mappings"          ,"value":[{"options":{"match":"null+nan","result":{"index":0,"text":"-"}},"type":"special"}]                                                                                                                                                                  }
            ]
          },{
            "matcher":{"id":"byName","options":"D"},
            "properties":[{"id":"custom.width","value":50},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"F"},"1":{"color":"#f79f64","index":1,"text":"T"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2,"text":"-"}},"type":"special"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]
          },
          {"matcher":{"id":"byName","options":"P"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"F"},"1":{"color":"#f79f64","index":1,"text":"T"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2,"text":"-"}},"type":"special"}]},{"id":"custom.width","value":50}]},
          {"matcher":{"id":"byName","options":"PoolSize"},"properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"type":"auto"}}]},{"matcher":{"id":"byName","options":"Target"},"properties":[{"id":"custom.minWidth","value":60},{"id":"custom.cellOptions","value":{"type":"auto"}},{"id":"custom.inspect","value":true}]},
          {
            "matcher":{"id":"byName","options":"OID"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                         },{ "id":"links"             ,"value":[{"title":"PGCAT Database : ${primary}.${__data.fields.Database}","url":"/d/pgcat-database?var-dsn=${primary}.${__data.fields.Database}"}] },
              { "id":"mappings"          ,"value":[{"options":{"from":0,"result":{"color":"#bfbfbf4d","index":0},"to":10},"type":"range"}]                                                   },{ "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                      },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]}                                                                                }
            ]
          }
        ]
      },
      "gridPos":{"h":7,"w":19,"x":0,"y":25},
      "id":127,
      "options":{"cellHeight":"sm","showHeader":true,"sortBy":[{"desc":true,"displayName":"Size"}]},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (datname) (pg_size_bytes{cls=\"$cls\", datname!~\"wal|log\"})"                                                                                              ,"format":"table",             "instant":true,"interval":"","legendFormat":"Age"          ,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pg:db:age{cls=\"$cls\"})"                                                                                                                        ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Commit"       ,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pg_db_is_template{cls=\"$cls\", ins=\"$primary\"})"                                                                                              ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"isTemplate"   ,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (datname) (pg_activity_count{cls=\"$cls\"})"                                                                                                                ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Backend"      ,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (datname) (pg:db:xact_commit_rate1m{cls=\"$cls\"})"                                                                                                         ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"TPS"          ,"refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pg_db_conn_limit{ins=\"$primary\"})"                                                                                                             ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Limit"   ,"refId":"F" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pgbouncer:db:query_rt_1m{ins=\"$primary\"})"                                                                                                     ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Limit"   ,"refId":"G" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pg:db:conn_usage{cls=\"$cls\"})"                                                                                                                 ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"PG Conn Usage","refId":"H" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pgbouncer_database_disabled{ins=\"$primary\", datname!=\"pgbouncer\"})"                                                                          ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Disabled"     ,"refId":"I" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname) (pgbouncer_database_paused{ins=\"$primary\", datname!=\"pgbouncer\"})"                                                                            ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Paused"       ,"refId":"J" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (datname) (pg:db:active_time_rate1m{cls=\"$cls\"}) / sum by (datname) (pg_db_numbackends{cls=\"$cls\"})"                                                    ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Usage"   ,"refId":"L" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (datname) (pgbouncer:db:active_servers{cls=\"$cls\"})"                                                                                                      ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Usage"   ,"refId":"M" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (datname) (pgbouncer:db:active_servers{cls=\"$cls\"})"                                                                                                      ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Usage"   ,"refId":"N" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (datname,host) (pgbouncer_database_pool_size{cls=\"$cls\", datname!=\"pgbouncer\"} + pgbouncer_database_reserve_pool{cls=\"$cls\", datname!=\"pgbouncer\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Age"          ,"refId":"K" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (datname) (pg_db_datid{cls=\"$cls\"})"                                                                                                                      ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"OID"          ,"refId":"O" }
      ],
      "title":"Database",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"datname"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time 1":true,"Time 10":true,"Time 11":true,"Time 12":true,"Time 13":true,"Time 14":true,"Time 15":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,"Value #G":false,"Value #H":false,"host":true},
            "indexByName":{
              "Time 1":17,
              "Time 10":26,
              "Time 11":27,
              "Time 12":28,
              "Time 13":29,
              "Time 14":30,
              "Time 15":31,
              "Time 2":18,
              "Time 3":19,
              "Time 4":20,
              "Time 5":21,
              "Time 6":22,
              "Time 7":23,
              "Time 8":24,
              "Time 9":25,
              "Value #A":2,
              "Value #B":3,
              "Value #C":15,
              "Value #D":4,
              "Value #E":5,
              "Value #F":11,
              "Value #G":6,
              "Value #H":10,
              "Value #I":13,
              "Value #J":14,
              "Value #K":12,
              "Value #L":9,
              "Value #M":8,
              "Value #N":7,
              "Value #O":1,
              "datname":0,
              "host":16
            },
            "renameByName":{"Time 1":"","Time 7":"","Value #A":"Size","Value #B":"Age","Value #C":"T","Value #D":"Backend","Value #E":"TPS","Value #F":"ConnLimit","Value #G":"RT","Value #H":"Conn%","Value #I":"D","Value #J":"P","Value #K":"PoolSize","Value #L":"Load","Value #M":"Client","Value #N":"Server","Value #O":"OID","datname":"Database","host":"Target","real_datname":"Datname"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Blue = PostgreSQL\n\nGreen = Pgbouncer\n\nYellow = Agent (Patroni / PG Exporters)",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[],"mappings":[{"options":{"0":{"color":"text","index":1,"text":"Dead"},"1":{"index":2,"text":"Up"}},"type":"value"},{"options":{"match":"null+nan","result":{"index":0}},"type":"special"}],"max":1.1,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#aaaaaa","value":1}]}},
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#3e668f","value":1}]}},{"id":"links","value":[{"title":"PGSQL Instance : ${__field.labels.ins}","url":"/d/pgsql-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"B"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#3d668fd6","value":1}]}},{"id":"links","value":[{"title":"PGSQL Pgbouncer : ${__field.labels.ins}","url":"/d/pgsql-pgbouncer?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                          },
          { "matcher":{"id":"byFrameRefID","options":"C"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#5b9cd5","value":1}]}},{"id":"links","value":[{"title":"PGSQL Instance : ${__field.labels.ins}","url":"/d/pgsql-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"D"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#b783af","value":1}]}},{"id":"links","value":[{"title":"PGSQL Exporter : ${__field.labels.ins}","url":"/d/pgsql-exporter?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"E"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#7771a4","value":1}]}},{"id":"links","value":[{"title":"PGSQL Exporter : ${__field.labels.ins}","url":"/d/pgsql-exporter?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"F"}       ,"properties":[{"id":"links","value":[{"title":"Node Instance : ${__field.labels.ins}","url":"/d/node-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#e6b03ee6","value":1}]}}]                              },
          { "matcher":{"id":"byFrameRefID","options":"G"}       ,"properties":[{"id":"links","value":[{"title":"Node HAProxy : ${__field.labels.ins}","url":"/d/node-haproxy?var-ins=${__field.labels.ins}&${__url_time_range}"}]},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#f79f64","value":1}]}}]                                  },
          { "matcher":{"id":"byFrameRefID","options":"H"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#1b6eb6d1","value":1}]}}]                                                                                                                                                                                    },
          { "matcher":{"id":"byFrameRefID","options":"I"}       ,"properties":[{"id":"links","value":[{"title":"Logs Instance : ${__field.labels.ins}","url":"/d/logs-instance?var-ins=${__field.labels.ins}&var-src=postgres&${__url_time_range}"}]},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#cc4637d9","value":1}]}}]             },
          { "matcher":{"id":"byFrameRefID","options":"JUICE"}   ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#8fad88","value":1}]}},{"id":"links","value":[{"title":"Node JuiceFS : ${__field.labels.ins}","url":"/d/node-juice?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                                    },
          { "matcher":{"id":"byFrameRefID","options":"NGINX"}   ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#346f36cc","value":1}]}},{"id":"links","value":[{"title":"Nginx Instance : ${__field.labels.ins}","url":"/d/nginx-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                            },
          { "matcher":{"id":"byFrameRefID","options":"GRAFANA"} ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#f79f64","value":1}]}},{"id":"links","value":[{"title":"Grafana Instance : ${__field.labels.ins}","url":"/d/grafana-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                          },
          { "matcher":{"id":"byFrameRefID","options":"VMETRICS"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#a64d4d","value":1}]}},{"id":"links","value":[{"title":"VMetrics Instance : ${__field.labels.ins}","url":"/d/vmetrics-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                        },
          { "matcher":{"id":"byFrameRefID","options":"VLOGS"}   ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#ba7552","value":1}]}},{"id":"links","value":[{"title":"VLogs Instance : ${__field.labels.ins}","url":"/d/vlogs-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"VTRACES"} ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#c4895c","value":1}]}},{"id":"links","value":[{"title":"VTraces Instance : ${__field.labels.ins}","url":"/d/vtraces-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                          },
          { "matcher":{"id":"byFrameRefID","options":"VMALERT"} ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#b3596d","value":1}]}},{"id":"links","value":[{"title":"VMAlert Instance : ${__field.labels.ins}","url":"/d/vmalert-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                          },
          { "matcher":{"id":"byFrameRefID","options":"ALERTMGR"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#db7070","value":1}]}},{"id":"links","value":[{"title":"AlertManager Instance : ${__field.labels.ins}","url":"/d/alertmanager-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                },
          { "matcher":{"id":"byFrameRefID","options":"K"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#5b9cd5","value":1}]}},{"id":"links","value":[{"title":"ETCD Overview","url":"/d/etcd-overview?${__url_time_range}"}]}]                                                                                      },
          { "matcher":{"id":"byFrameRefID","options":"L"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#cc4637d9","value":1}]}},{"id":"links","value":[{"title":"Redis Instance ${__field.labels.ins} @ ${__field.labels.instance}","url":"/d/redis-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}] },
          { "matcher":{"id":"byFrameRefID","options":"M"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#d0475799","value":1}]}},{"id":"links","value":[{"title":"Minio Instance: ${__field.labels.ins}","url":"/d/minio-overview?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                             },
          { "matcher":{"id":"byFrameRefID","options":"N"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#806c52","value":1}]}},{"id":"links","value":[{"title":"Mongo Instance : ${__field.labels.ins}","url":"/d/mongo-overview?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"Y"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#6a8d9d","value":1}]}},{"id":"links","value":[{"title":"MySQL Instance : ${__field.labels.ins}","url":"/d/mysql-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              },
          { "matcher":{"id":"byFrameRefID","options":"P"}       ,"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#5a8da5","value":1}]}},{"id":"links","value":[{"title":"MySQL Instance : ${__field.labels.ins}","url":"/d/mysql-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]                              }
        ]
      },
      "gridPos":{"h":7,"w":5,"x":19,"y":25},
      "id":126,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"fields":"","values":false},"showPercentChange":false,"text":{"valueSize":12},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_up{ip=\"$ip\"}"                                  ,"hide":false,"instant":true,"interval":"","legendFormat":"postgres {{ ins }}"    ,"refId":"A"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pgbouncer_up{ip=\"$ip\"}"                           ,"hide":false,"instant":true,"interval":"","legendFormat":"pgbouncer {{ ins }}"   ,"refId":"B"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"patroni_up{ip=\"$ip\"}"                             ,"hide":false,"instant":true,"interval":"","legendFormat":"patroni {{ ins }}"     ,"refId":"C"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_exporter_agent_up{ip=\"$ip\"}"                   ,"hide":false,"instant":true,"interval":"","legendFormat":"pg_exporter {{ ins }}" ,"refId":"D"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pgbouncer_exporter_agent_up{ip=\"$ip\"}"            ,"hide":false,"instant":true,"interval":"","legendFormat":"pgb_exporter {{ ins }}","refId":"E"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"node_up{ip=\"$ip\"}"                                ,"hide":false,"instant":true,"interval":"","legendFormat":"node {{ ins }}"        ,"refId":"F"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"haproxy_up{ip=\"$ip\"}"                             ,"hide":false,"instant":true,"interval":"","legendFormat":"haproxy {{ ins }}"     ,"refId":"G"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"docker_up{ip=\"$ip\"}"                              ,"hide":false,"instant":true,"interval":"","legendFormat":"docker {{ ins }}"      ,"refId":"H"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"vector_up{ip=\"$ip\"}"                              ,"hide":false,"instant":true,"interval":"","legendFormat":"vector {{ ins }}"      ,"refId":"I"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{job=\"juice\", ip=\"$ip\"})"       ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"JUICE"    },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"nginx\", ip=\"$ip\"})"       ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"NGINX"    },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"grafana\", ip=\"$ip\"})"     ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"GRAFANA"  },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"vmetrics\", ip=\"$ip\"})"    ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"VMETRICS" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"vlogs\", ip=\"$ip\"})"       ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"VLOGS"    },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"vtraces\", ip=\"$ip\"})"     ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"VTRACES"  },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"vmalert\", ip=\"$ip\"})"     ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"VMALERT"  },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (up{cls=\"alertmanager\", ip=\"$ip\"})","hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"ALERTMGR" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"etcd_up{ip=\"$ip\"}"                                ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"K"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"redis_up{ip=\"$ip\"}"                               ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"L"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"minio_up{ip=\"$ip\"}"                               ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"M"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"mongo_up{ip=\"$ip\"}"                               ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"             ,"refId":"N"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"mysql_up{ip=\"$ip\"}"                               ,"hide":false,"instant":true,"interval":"","legendFormat":"mysql {{ ins }}"       ,"refId":"Y"        },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"mysql_exporter_up{ip=\"$ip\"}"                      ,"hide":false,"instant":true,"interval":"","legendFormat":"mysql_exporter"        ,"refId":"P"        }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"footer":{"reducers":[]},"inspect":false},"mappings":[{"options":{"match":"null+nan","result":{"color":"transparent","index":1}},"type":"special"}],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]}},
        "overrides":[
          {"matcher":{"id":"byName","options":"Instance"},"properties":[{"id":"links","value":[{"title":"PGSQL Instance: ${__data.fields.Instance}","url":"/d/pgsql-instance?var-ins=${__data.fields.Instance}&${__url_time_range}"}]},{"id":"custom.minWidth","value":120}]},
          {"matcher":{"id":"byName","options":"Cluster"},"properties":[{"id":"links","value":[{"title":"PGSQL Cluster: ${__data.fields.Cluster}","url":"/d/pgsql-cluster?var-cls=${__data.fields.Cluster}&${__url_time_range}"}]},{"id":"custom.minWidth","value":120}]},
          {"matcher":{"id":"byName","options":"Shard"},"properties":[{"id":"links","value":[{"title":"PGSQL Shard : ${__data.fields.Shard}","url":"/d/pgsql-shard?var-shard=${__data.fields.Shard}&${__url_time_range}"}]},{"id":"custom.width","value":100}]},
          {
            "matcher":{"id":"byName","options":"Status"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                                                                                                                         },
              { "id":"mappings"          ,"value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Replica"},"1":{"color":"#3e668f","index":1,"text":"Primary"},"2":{"color":"#f79f64","index":2,"text":"Standby Leader"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"#808080","index":3,"text":"Unknown"}},"type":"special"}] },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                                                                              }
            ]
          },
          {"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":80}]},{"matcher":{"id":"byName","options":"PG Ver"},"properties":[{"id":"custom.width","value":80}]},
          {
            "matcher":{"id":"byName","options":"Paused"},
            "properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"OK"},"1":{"color":"#f79f64","index":1,"text":"Paused"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]
          },{
            "matcher":{"id":"byName","options":"Lock"},
            "properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Unlocked"},"1":{"color":"#b783af","index":1,"text":"Locked"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]
          },{
            "matcher":{"id":"byName","options":"Restart"},
            "properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"No Need"},"1":{"color":"#f79f64","index":1,"text":"Pending"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]
          },{
            "matcher":{"id":"byName","options":"Failsafe"},
            "properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Inactive"},"1":{"color":"#cc4637d9","index":1,"text":"Active"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]
          },{
            "matcher":{"id":"byName","options":"WAL"},
            "properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"mappings","value":[{"options":{"0":{"color":"#346f36cc","index":0,"text":"Proceed"},"1":{"color":"#f79f64","index":1,"text":"Paused"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]
          },{
            "matcher":{"id":"byName","options":"Postgres"},
            "properties":[{"id":"custom.width","value":80},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"mappings","value":[{"options":{"0":{"color":"#cc4637d9","index":0,"text":"Down"},"1":{"color":"#346f36cc","index":1,"text":"Alive"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}]}]
          },
          {"matcher":{"id":"byName","options":"PG Uptime "},"properties":[{"id":"custom.width","value":100},{"id":"unit","value":"s"},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#cc4637d9","value":0},{"color":"#f79f64","value":300},{"color":"#fcdb72","value":3600},{"color":"#346f36cc","value":86400}]}}]},
          {
            "matcher":{"id":"byName","options":"DCS Seen"},
            "properties":[{"id":"custom.width","value":100},{"id":"unit","value":"s"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#f79f64","value":20},{"color":"#cc4637d9","value":30},{"color":"#b783af","value":60},{"color":"text","value":300}]}},{"id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}}]
          },
          {"matcher":{"id":"byName","options":"Up"},"properties":[{"id":"custom.width","value":90},{"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":7,"w":19,"x":0,"y":32},
      "id":131,
      "links":[{"title":"PGSQL Patroni : ${cls}","url":"/d/pgsql-patroni?var-cls=${cls}&${__url_time_range}"}],
      "options":{"cellHeight":"sm","showHeader":true,"sortBy":[]},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_primary{cls=\"$cls\"}) + \nmax by (ins) (patroni_standby_leader{cls=\"$cls\"})","format":"table",             "instant":true,"legendFormat":"__auto","range":false,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (cls,ins,scope) (patroni_version{cls=\"$cls\"})"                                              ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_postgres_server_version{cls=\"$cls\"})"                                        ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_is_paused{cls=\"$cls\"})"                                                      ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_cluster_unlocked{cls=\"$cls\"})"                                               ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_pending_restart{cls=\"$cls\"})"                                                ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"F" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_failsafe_mode_is_active{cls=\"$cls\"})"                                        ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"G" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_xlog_paused{cls=\"$cls\"})"                                                    ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"H" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_postgres_running{cls=\"$cls\"})"                                               ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"I" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (time() - patroni_dcs_last_seen{cls=\"$cls\"})"                                         ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"J" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (time() - patroni_postmaster_start_time{cls=\"$cls\"})"                                 ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"K" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_up{cls=\"$cls\"})"                                                             ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"L" }
      ],
      "title":"Patroni Members",
      "transformations":[
        {"id":"joinByField","options":{"byField":"ins","mode":"outer"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Time 1":true,"Time 10":true,"Time 11":true,"Time 12":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,"Value #E":false,"__name__ 1":false,"cls":true,"scope":false},
            "indexByName":{"Time 1":15,"Time 10":24,"Time 11":25,"Time 12":26,"Time 2":16,"Time 3":17,"Time 4":18,"Time 5":19,"Time 6":20,"Time 7":21,"Time 8":22,"Time 9":23,"Value #A":1,"Value #B":13,"Value #C":14,"Value #D":6,"Value #E":7,"Value #F":8,"Value #G":9,"Value #H":10,"Value #I":11,"Value #J":5,"Value #K":12,"Value #L":0,"cls":3,"ins":2,"scope":4},
            "renameByName":{"Value #A":"Status","Value #B":"Version","Value #C":"PG Ver","Value #D":"Paused","Value #E":"Lock","Value #F":"Restart","Value #G":"Failsafe","Value #H":"WAL","Value #I":"Postgres","Value #J":"DCS Seen","Value #K":"PG Uptime ","Value #L":"Up","cls":"Cluster","ins":"Instance","scope":"Shard"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]},"unit":"string"},"overrides":[]},
      "gridPos":{"h":7,"w":5,"x":19,"y":32},
      "id":111,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":false},"showPercentChange":false,"text":{"titleSize":12},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_meta_info{ins=\"$ins\"}","format":"table","instant":true,"interval":"","legendFormat":"","range":false,"refId":"A"}],
      "title":"Configuration",
      "transformations":[
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Value":true,"Value #A":true,"__name__":true,"cls":true,"cluster_name":true,"encoding":true,"extensions":true,"ins":true,"instance":true,"ip":true,"job":true,"primary_conninfo":true,"ver_num":false,"ver_str":true,"version":true},
            "includeByName":{},
            "indexByName":{"Time":12,"Value":18,"__name__":13,"cls":11,"cluster_id":9,"cluster_name":2,"conf_path":6,"data_dir":5,"encoding":7,"extensions":10,"hba_path":8,"ins":14,"instance":15,"ip":17,"job":16,"listen_port":4,"ver_num":0,"ver_str":19,"version":1,"wal_level":3},
            "renameByName":{"Time":"","Value":"","cls":"","cluster_id":"ClusterID","cluster_name":"CLS","conf_path":"Config","data_dir":"Data","encoding":"Encoding","extensions":"Library","hba_path":"HBA","listen_port":"Port","primary_conninfo":"Primary","ver_num":"Version","version":"Version","wal_level":"WAL"}
          }
        }
      ],
      "type":"stat"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":39},"id":64,"panels":[],"title":"Metrics","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"none",
            "hideFrom":{"graph":false,"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"auto",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"red","value":80}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":40},
      "id":72,
      "options":{"legend":{"calcs":["mean","lastNotNull"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"avg_over_time(node:cpu:usage{ip=\"$ip\"}[1m])","interval":"","intervalFactor":2,"legendFormat":"CPU {{ cpu }}","range":true,"refId":"A"}],
      "title":"CPU Core Usage",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":30,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"s"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":40},
      "id":92,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg_repl_replay_lag{cls=\"$cls\", appname=\"$ins\"}","interval":"","legendFormat":"upstream's View","refId":"A"},{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg_lag{ins=\"$ins\"}","hide":false,"interval":"","legendFormat":"{{ ins }}'s View","refId":"B"}],
      "title":"Replication Lag in Seconds",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Average transaction response time from Pgbouncer.\nYou can use PostgreSQL metric after PG14",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"opacity",
            "hideFrom":{"graph":false,"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"s"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"instance"},"properties":[{"id":"custom.fillOpacity","value":73},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"super-light-blue","mode":"fixed"}}]                                   },
          { "matcher":{"id":"byFrameRefID","options":"B"} ,"properties":[{"id":"links","value":[{"title":"PGSQL Database for ${__field.labels.datname}","url":"/d/pgsql-database?var-ins=${ins}&var-datname=${__field.labels.datname}&${__url_time_range}"}]}] }
        ]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":47},
      "id":68,
      "options":{"legend":{"calcs":["mean","min","max","last"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"#pgbouncer:ins:xact_rt_1m{ins=\"$ins\"}\npg:ins:active_time_rate1m{ins=\"$ins\"} / pg:ins:xact_total_rate1m{ins=\"$ins\"} # PG14"                                                  ,             "interval":"","intervalFactor":1,"legendFormat":"instance"     ,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"# pgbouncer:db:xact_rt_1m{ins=\"$ins\"}\npg:db:active_time_rate1m{ins=\"$ins\", datname!~'template\\\\d'} / pg:db:xact_total_rate1m{ins=\"$ins\", datname!~'template\\\\d'} # PG14","hide":false,"interval":"","intervalFactor":1,"legendFormat":"{{ datname }}","refId":"B" }
      ],
      "title":"RT",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"stepBefore",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"auto",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]}
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"autovacuum launcher"},"properties":[{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]                                                                                                                                                            },
          { "matcher":{"id":"byName","options":"background writer"}  ,"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]                                                                                                                                                            },
          { "matcher":{"id":"byName","options":"checkpointer"}       ,"properties":[{"id":"color","value":{"fixedColor":"super-light-orange","mode":"fixed"}}]                                                                                                                                                 },
          { "matcher":{"id":"byName","options":"walwriter"}          ,"properties":[{"id":"color","value":{"fixedColor":"super-light-blue","mode":"fixed"}}]                                                                                                                                                   },
          { "matcher":{"id":"byFrameRefID","options":"A"}            ,"properties":[{"id":"links","value":[{"title":"PGSQL Database for ${__field.labels.ins}.${__field.labels.datname}","url":"/d/pgsql-database?var-datname=${__field.labels.datname}&var-ins=${__field.labels.ins}&${__url_time_range}"}]}] }
        ]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":47},
      "id":94,
      "options":{"legend":{"calcs":["last"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg_db_numbackends{ins=\"$ins\", datname!~'template\\\\d'}","hide":false,"interval":"","legendFormat":"client backend @ {{ datname }}","refId":"A"}],
      "title":"Session",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Transactions per seconds for each database in Last 5 minutes",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":60,
            "gradientMode":"hue",
            "hideFrom":{"graph":false,"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[{"title":"PGSQL Database for ${__field.labels.datname}","url":"/d/pgsql-database?var-ins=${ins}&var-cls=${cls}&var-datname=${__field.labels.datname}&${__url_time_range}"}],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":55},
      "id":66,
      "options":{"legend":{"calcs":["lastNotNull"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_db_xact_total{ins=\"$ins\",datname!~\"template[0-9]\"}[5m])","hide":false,"interval":"","intervalFactor":1,"legendFormat":"{{ datname }}","refId":"B"}],
      "title":"TPS",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Tuples fetched, inserted, updated, delete among this cluster",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"cps"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"DELETED"} ,"properties":[{"id":"color","value":{"fixedColor":"#cc4637d9","mode":"fixed"}}] },{ "matcher":{"id":"byName","options":"INSERTED"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]   },{ "matcher":{"id":"byName","options":"UPDATED"} ,"properties":[{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]   },
          { "matcher":{"id":"byName","options":"SELECT"}  ,"properties":[{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":55},
      "id":96,
      "links":[{"title":"PGSQL Database : CRUD for ${primary}","url":"/d/pgsql-database?var-ins=${primary}&${__url_time_range}"}],
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum(rate(pg_db_tup_fetched{ins=\"$ins\"}[1m]))" ,             "interval":"","intervalFactor":2,"legendFormat":"SELECT"  ,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum(rate(pg_db_tup_inserted{ins=\"$ins\"}[1m]))","hide":false,"interval":"","intervalFactor":2,"legendFormat":"INSERTED","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum(rate(pg_db_tup_updated{ins=\"$ins\"}[1m]))" ,"hide":false,"interval":"","intervalFactor":2,"legendFormat":"UPDATED" ,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum(rate(pg_db_tup_deleted{ins=\"$ins\"}[1m]))" ,"hide":false,"interval":"","intervalFactor":2,"legendFormat":"DELETED" ,"refId":"D" }
      ],
      "title":"CRUD",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Time spent per second for each query of each instances.",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":70,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":0,
            "pointSize":1,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"auto",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[
            { "title":"PGSQL Query : ${datname} - ${__field.labels.query}"               ,"url":"/d/pgsql-query?var-ins=${__field.labels.ins}&var-cls=${cls}&var-datname=${__field.labels.datname}&var-query=${__field.labels.query}&${__url_time_range}" },
            { "title":"PGCAT Query : ${__field.labels.datname} - ${__field.labels.query}","url":"/d/pgcat-query?var-dsn=${ins}.${__field.labels.datname}&var-query=${__field.labels.query}&${__url_time_range}"                                           }
          ],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"green","value":0}]},
          "unit":"s"
        },
        "overrides":[]
      },
      "gridPos":{"h":9,"w":10,"x":0,"y":62},
      "id":90,
      "links":[{"title":"PGSQL Pgbouncer : ${ins}","url":"/d/pgsql-pgbouncer?var-ins=${ins}&${__url_time_range}"}],
      "options":{"legend":{"calcs":["max","mean","lastNotNull"],"displayMode":"table","placement":"bottom","showLegend":true,"sortBy":"Mean","sortDesc":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"rate(pg_query_exec_time{ins=\"$ins\"}[5m])","interval":"","intervalFactor":2,"legendFormat":"{{ datname }}-{{ query }}","refId":"B"}],
      "title":"Statements RT",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"R\u25b2 for disk read bandwidth\nTX\u25b2 for network transmit bandwidth\nRX\u25bc for network receive bandwidth\nW\u25bc for disk write bandwidth",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"red","value":80}]},
          "unit":"Bps"
        },
        "overrides":[]
      },
      "gridPos":{"h":9,"w":14,"x":10,"y":62},
      "id":88,
      "options":{"legend":{"calcs":["mean"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"node:dev:disk_read_bytes_rate1m{ip=\"$ip\"}"   ,             "interval":"","legendFormat":"{{ device }}-R\u25b2" ,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"node:dev:network_tx_bytes_rate1m{ip=\"$ip\"}"  ,"hide":false,"interval":"","legendFormat":"{{ device }}-TX\u25b2","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"- node:dev:network_rx_bytes_rate1m{ip=\"$ip\"}","hide":false,"interval":"","legendFormat":"{{ device }}-RX\u25bc","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"- node:dev:disk_write_bytes_rate1m{ip=\"$ip\"}",             "interval":"","legendFormat":"{{ device }}-W\u25bc" ,"refId":"D" }
      ],
      "title":"Disk / Network",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":71},"id":98,"panels":[],"title":"Logs","type":"row"},
    {
      "datasource":{"type":"victoriametrics-logs-datasource","uid":"ds-vlogs"},
      "description":"PGSQL Logs Event",
      "fieldConfig":{
        "defaults":{
          "color":{"fixedColor":"#346f36cc","mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"bars",
            "fillOpacity":100,
            "gradientMode":"none",
            "hideFrom":{"graph":false,"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "showValues":false,
            "spanNulls":true,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "decimals":0,
          "mappings":[],
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"none"
        },
        "overrides":[{"matcher":{"id":"byName","options":"postgres"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]
      },
      "gridPos":{"h":6,"w":24,"x":0,"y":72},
      "id":100,
      "interval":"1s",
      "options":{"legend":{"calcs":["sum"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"victoriametrics-logs-datasource","uid":"ds-vlogs"},"editorMode":"code","expr":"ins:$ins job:postgres | stats count() as count"                                                                                                                                            ,             "legendFormat":"postgres"  ,"queryType":"statsRange","refId":"A" },
        { "datasource":{"type":"victoriametrics-logs-datasource","uid":"ds-vlogs"},"editorMode":"code","expr":"job:pgbackrest ins:$ins\n| stats count() as count"                                                                                                                                         ,"hide":false,"legendFormat":"pgbackrest","queryType":"statsRange","refId":"B" },
        { "datasource":{"type":"victoriametrics-logs-datasource","uid":"ds-vlogs"},"editorMode":"code","expr":"job:syslog ip:$ip\napp:in(\"postgres\", \"patroni\", \"pgbouncer\", \"pg_exporter\", \"pgbouncer_exporter\", \"pgbackrest_exporter\", \"vip-manager\") \n| stats by (app) count() as count","hide":false,"legendFormat":"{{ app }}" ,"queryType":"statsRange","refId":"C" }
      ],
      "title":"PG Logs",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"victoriametrics-logs-datasource","uid":"ds-vlogs"},
      "description":"Recent logs for PGSQL components: postgres & patroni & pgbouncer & pgbackrest & exporters & vip-manager",
      "gridPos":{"h":18,"w":24,"x":0,"y":78},
      "id":102,
      "options":{"dedupStrategy":"none","detailsMode":"sidebar","enableInfiniteScrolling":true,"enableLogDetails":true,"fontSize":"small","prettifyLogMessage":false,"showCommonLabels":false,"showControls":true,"showLabels":false,"showTime":true,"sortOrder":"Descending","timestampResolution":"ns","wrapLogMessage":false},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"victoriametrics-logs-datasource","uid":"ds-vlogs"},"editorMode":"code","expr":"ins:$ins job:postgres","instant":false,"queryType":"instant","range":true,"refId":"A"}],
      "title":"PostgreSQL Logs",
      "type":"logs"
    }
  ],
  "preload":false,
  "refresh":"",
  "schemaVersion":42,
  "tags":["Pigsty","PGSQL","Instance"],
  "templating":{
    "list":[
      {"current":{},"datasource":{"type":"prometheus","uid":"ds-prometheus"},"definition":"label_values(pg_up, ins)","description":"Unique instance identifier (e.g pg-meta-1)","includeAll":false,"label":"Instance","name":"ins","options":[],"query":{"query":"label_values(pg_up, ins)","refId":"StandardVariableQuery"},"refresh":1,"regex":"","sort":1,"type":"query"},
      {"current":{},"datasource":{"type":"prometheus","uid":"ds-prometheus"},"definition":"label_values(pg_up{ins=\"$ins\"} , ip)","description":"IP address of this postgres instance","hide":2,"includeAll":false,"label":"IP","name":"ip","options":[],"query":{"query":"label_values(pg_up{ins=\"$ins\"} , ip)","refId":"StandardVariableQuery"},"refresh":1,"regex":"","sort":1,"type":"query"},
      {
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_up{ins=\"$ins\"},  ins)",
        "description":"Sequence number of this instance, which is an unique integer among a postgres cluster",
        "hide":2,
        "includeAll":false,
        "label":"Sequence",
        "name":"seq",
        "options":[],
        "query":{"query":"label_values(pg_up{ins=\"$ins\"},  ins)","refId":"StandardVariableQuery"},
        "refresh":1,
        "regex":"/^[a-zA-Z0-9-_]+-(\\d+)$/",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_up{ins=\"$ins\"}, cls)",
        "description":"Cluster identifier for this postgres instance, cls should be unique among entire environment. such as pg-meta, pg-test",
        "hide":2,
        "includeAll":false,
        "label":"Cluster",
        "name":"cls",
        "options":[],
        "query":{"query":"label_values(pg_up{ins=\"$ins\"}, cls)","refId":"StandardVariableQuery"},
        "refresh":1,
        "regex":"",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(node_uname_info{ip=\"$ip\"},nodename)",
        "description":"Node name of current postgres instance",
        "hide":2,
        "includeAll":false,
        "label":"Node",
        "name":"node",
        "options":[],
        "query":{"query":"label_values(node_uname_info{ip=\"$ip\"},nodename)","refId":"PrometheusVariableQueryEditor-VariableQuery"},
        "refresh":1,
        "regex":"",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_db_age{ins=\"$ins\",datname!~'postgres|template0|template1'}, datname)",
        "description":"Non-trivial database in this instance",
        "hide":2,
        "includeAll":false,
        "label":"Database",
        "name":"datname",
        "options":[],
        "query":{"query":"label_values(pg_db_age{ins=\"$ins\",datname!~'postgres|template0|template1'}, datname)","refId":"StandardVariableQuery"},
        "refresh":1,
        "regex":"",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(node_load1{ip=\"$ip\"},ins)",
        "description":"Node Ins Label",
        "hide":2,
        "includeAll":false,
        "label":"Node Instance",
        "name":"node_ins",
        "options":[],
        "query":{"query":"label_values(node_load1{ip=\"$ip\"},ins)","refId":"PrometheusVariableQueryEditor-VariableQuery"},
        "refresh":1,
        "regex":"",
        "sort":1,
        "type":"query"
      }
    ]
  },
  "time":{"from":"now-1h","to":"now"},
  "timepicker":{},
  "timezone":"browser",
  "title":"PGSQL Instance",
  "uid":"pgsql-instance",
  "version":1,
  "weekStart":""
}