{
  "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 Monitoring HQ",
  "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":132,"panels":[],"title":"Overview","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"links":[{"title":"Node Overview","url":"/d/node-overview?${__url_time_range}"}],"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]}},"overrides":[]},
      "gridPos":{"h":3,"w":8,"x":0,"y":1},
      "id":99,
      "options":{"colorMode":"background","graphMode":"none","justifyMode":"center","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"1","format":"table","instant":true,"interval":"","legendFormat":"","queryType":"measurements","refId":"A"}],
      "transformations":[{"id":"organize","options":{"excludeByName":{"Time":true},"indexByName":{},"renameByName":{"Time":"","Value":"${job}"}}}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"mappings":[],"max":2.5,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]}},
        "overrides":[
          { "matcher":{"id":"byRegexp","options":"/Mem|Disk|Data/"},"properties":[{"id":"unit","value":"bytes"},{"id":"decimals","value":0}]                                         },{ "matcher":{"id":"byName","options":"Cluster"}          ,"properties":[{"id":"links","value":[{"title":"PGSQL Cluster","url":"/d/pgsql-cluster?${__url_time_range}"}]}]   },
          { "matcher":{"id":"byName","options":"Instance"}         ,"properties":[{"id":"links","value":[{"title":"PGSQL Instance","url":"/d/pgsql-instance?${__url_time_range}"}]}] },{ "matcher":{"id":"byName","options":"Service"}          ,"properties":[{"id":"links","value":[{"title":"PGSQL Service","url":"/d/pgsql-service?${__url_time_range}"}]}]   },
          { "matcher":{"id":"byName","options":"Node"}             ,"properties":[{"id":"links","value":[{"title":"PGSQL Node","url":"/d/node-instance?${__url_time_range}"}]}]      },{ "matcher":{"id":"byName","options":"DB"}               ,"properties":[{"id":"links","value":[{"title":"PGSQL Database","url":"/d/pgsql-database?${__url_time_range}"}]}] }
        ]
      },
      "gridPos":{"h":3,"w":16,"x":8,"y":1},
      "id":31,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"center","orientation":"vertical","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":14},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"count(count by (cls) (pg_up{job=\"$job\"}))"                                                   ,"hide":false,"instant":true,"interval":"","legendFormat":"Cluster" ,"queryType":"measurements","refId":"G" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"count(pg_up{job=\"$job\"})"                                                                    ,"hide":false,"instant":true,"interval":"","legendFormat":"Instance","queryType":"measurements","refId":"I" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"count(pg_in_recovery{job=\"$job\"} == 1)"                                                      ,"hide":true ,"instant":true,"interval":"","legendFormat":"Replica" ,"queryType":"measurements","refId":"H" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"count(count by (proxy) (haproxy_server_status{job=\"$job\"}))"                                 ,"hide":false,"instant":true,"interval":"","legendFormat":"Service" ,"queryType":"measurements","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"count(count(pg_up{job=\"$job\"}) by (ip))"                                                     ,             "instant":true,"interval":"","legendFormat":"Node"    ,"queryType":"measurements","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"count(max by (cls,datname) (pg_db_age{job=\"$job\", datname!~'template0|template1|postgres'}))","hide":false,"instant":true,"interval":"","legendFormat":"DB"      ,"queryType":"measurements","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum(pg:cls:cpu_count{job=\"$job\"})"                                                           ,"hide":false,"instant":true,"interval":"","legendFormat":"Core"    ,"queryType":"measurements","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum(pg:ins:mem_size{job=\"$job\"})"                                                            ,"hide":false,"instant":true,"interval":"","legendFormat":"Mem"     ,"queryType":"measurements","refId":"F" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum(pg:ins:fs_size{job=\"$job\"})"                                                             ,"hide":true ,"instant":true,"interval":"","legendFormat":"Disk"    ,"queryType":"measurements","refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum(max by (cls,datname)(pg_size_bytes{datname!~\"log|wal\", job=\"$job\"}))"                  ,"hide":false,"instant":true,"interval":"","legendFormat":"Data"    ,"queryType":"measurements","refId":"J" }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"ETCD Health server ratio, and number of Postgres cluster in Failsafe mode",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[{"title":"ETCD Overview","url":"/d/etcd-overview?${__url_time_range}"}],"mappings":[],"noValue":"N/A","thresholds":{"mode":"absolute","steps":[{"color":"red","value":0}]},"unit":"none"},
        "overrides":[
          {
            "matcher":{"id":"byName","options":"ETCD Status"},
            "properties":[
              {
                "id":"mappings",
                "value":[
                  { "options":{"0":{"color":"#b783af","index":0,"text":"All Dead"},"1":{"color":"#346f36cc","index":1,"text":"Healthy"}},"type":"value"   },{ "options":{"match":"null+nan","result":{"color":"#b783af","index":2,"text":"Unknown"}}                              ,"type":"special" },
                  { "options":{"from":0.49999,"result":{"color":"#cc4637d9","index":3,"text":"1 / 2"},"to":0.50001}                     ,"type":"range"   },{ "options":{"from":0.66666,"result":{"color":"#f79f64","index":4,"text":"2 / 3"},"to":0.66667}                       ,"type":"range"   },
                  { "options":{"from":0.33333,"result":{"color":"#b783af","index":5,"text":"1 / 3"},"to":0.33334}                       ,"type":"range"   }
                ]
              },
              {"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#cc4637d9","value":0.5},{"color":"#f79f64","value":0.66},{"color":"#346f36cc","value":1}]}},{"id":"unit","value":"percentunit"},{"id":"decimals","value":0}
            ]
          },
          {"matcher":{"id":"byName","options":"Failsafe Mode"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#cc4637d9","value":1}]}},{"id":"mappings","value":[{"options":{"0":{"index":0,"text":"Healthy"}},"type":"value"}]}]}
        ]
      },
      "gridPos":{"h":3,"w":4,"x":0,"y":4},
      "id":127,
      "maxDataPoints":100,
      "options":{"colorMode":"background","graphMode":"none","justifyMode":"auto","orientation":"vertical","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":10},"textMode":"auto","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum(up{job=\"etcd\", cls=\"etcd\"}) by (cls) /\n count(up{job=\"etcd\", cls=\"etcd\"}) by (cls)\nor on() vector(0)","format":"time_series",             "instant":true,"intervalFactor":2,"legendFormat":"ETCD Status"  ,"range":false,"refId":"A","step":600 },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum(max by (cls) (patroni_failsafe_mode_is_active{}))"                                                             ,"format":"time_series","hide":false,"instant":true,"intervalFactor":2,"legendFormat":"Failsafe Mode","range":false,"refId":"B","step":600 }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Alert: CPU","url":"/d/pgsql-alert?viewPanel=43&${__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":"#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":3,"w":2,"x":4,"y":4},
      "id":82,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg:env:cpu_usage{job=\"$job\"}","interval":"","legendFormat":"CPU","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"links":[{"title":"PGSQL Alert: Backend Session","url":"/d/pgsql-alert?viewPanel=101&${__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}]},"unit":"none"},"overrides":[]},
      "gridPos":{"h":3,"w":2,"x":6,"y":4},
      "id":76,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum(pg:cls:num_backends{job=\"$job\"})","interval":"","legendFormat":"Session","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"links":[{"title":"PGSQL Alert: Xact Commit","url":"/d/pgsql-alert?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":"#346f36cc","value":0}]},"unit":"none"},"overrides":[]},
      "gridPos":{"h":3,"w":2,"x":8,"y":4},
      "id":72,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg:env:xact_commit_rate1m{job=\"$job\"}","interval":"","legendFormat":"Commit","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[{"title":"PGSQL Alert: Rollback","url":"/d/pgsql-alert?viewPanel=99&${__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":"#EAB839","value":10}]},"unit":"none"},
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":10,"y":4},
      "id":73,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg:env:xact_rollback_rate1m{job=\"$job\"}","interval":"","legendFormat":"Rollback","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"Node Alert: FS Space","url":"/d/node-alert?viewPanel=23&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "max":1,
          "min":0,
          "noValue":"\u2205",
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#fcdb72","value":0.8},{"color":"#f79f64","value":0.85},{"color":"red","value":0.9},{"color":"#b783af","value":0.95},{"color":"text","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":12,"y":4},
      "id":87,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"max(pg:ins:space_usage{job=\"$job\"})","interval":"","legendFormat":"Space Max","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":2,
          "links":[{"title":"PGSQL Alert: Age","url":"/d/pgsql-alert?viewPanel=82&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"\u2205"}},"type":"special"}],
          "max":1,
          "min":0,
          "noValue":"\u2205",
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#fcdb72","value":0.8},{"color":"#f79f64","value":0.85},{"color":"red","value":0.9},{"color":"#b783af","value":0.95},{"color":"text","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":14,"y":4},
      "id":85,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"pg:env:age{job=\"$job\"}","interval":"","legendFormat":"Age Max","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Alert: Lag in Bytes","url":"/d/pgsql-alert?viewPanel=86&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"Lag = \u2205"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#fcdb72","value":1000},{"color":"#f79f64","value":100000},{"color":"red","value":1000000},{"color":"#b783af","value":10000000},{"color":"text","value":100000000}]},
          "unit":"decbytes"
        },
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":16,"y":4},
      "id":102,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"max(pg:cls:lag_bytes{job=\"$job\"})","interval":"","legendFormat":"Lag Max","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Alert: Idle in Transaction","url":"/d/pgsql-alert?viewPanel=79&${__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":"#f79f64","value":1},{"color":"red","value":8}]},
          "unit":"none"
        },
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":18,"y":4},
      "id":78,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"max(pg:cls:ixact_backends{job=\"$job\"})","interval":"","legendFormat":"iXact Max","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Alert: Waiting Clients","url":"/d/pgsql-alert?viewPanel=89&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"#808080","index":0,"text":"Queue Nowait"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0},{"color":"#f79f64","value":1},{"color":"red","value":8}]},
          "unit":"none"
        },
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":20,"y":4},
      "id":77,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","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":"max(pgbouncer:cls:waiting_clients{job=\"$job\"})","interval":"","legendFormat":"Queue Max","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":1,
          "links":[{"title":"PGSQL Alert: Connection Usage","url":"/d/pgsql-alert?viewPanel=76&${__url_time_range}"}],
          "mappings":[{"options":{"match":"null+nan","result":{"color":"#808080","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":"red","value":0.7},{"color":"#b783af","value":0.9}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":3,"w":2,"x":22,"y":4},
      "id":79,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":12,"valueSize":18},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"max(pg:ins:conn_usage{job=\"$job\"})","instant":false,"interval":"","legendFormat":"Conn Max","refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":1,
          "links":[{"title":"PGSQL Cluster ${__field.labels.cls}","url":"/d/pgsql-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"}],
          "mappings":[{"options":{"-1":{"color":"gray","index":1,"text":"N/A"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"#3e668f","index":0,"text":"No Clusters"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0}]},
          "unit":"percentunit"
        },
        "overrides":[
          {"matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"links","value":[{"title":"PGSQL Cluster ${__field.labels.cls}","url":"/d/pgsql-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"}]},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},
          {"matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"links","value":[{"title":"Redis Cluster ${__field.labels.cls}","url":"/d/redis-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"}]},{"id":"color","value":{"fixedColor":"#cc4637d9","mode":"fixed"}}]},
          {"matcher":{"id":"byFrameRefID","options":"C"},"properties":[{"id":"links","value":[{"title":"Node Cluster : ${__field.labels.cls}","url":"/d/node-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"}]},{"id":"color","value":{"fixedColor":"#e6b03ee6","mode":"fixed"}}]},
          {
            "matcher":{"id":"byFrameRefID","options":"D"},
            "properties":[
              { "id":"color"     ,"value":{"fixedColor":"#5b9cd5","mode":"thresholds"}                                                                                                           },{ "id":"links"     ,"value":[{"title":"ETCD Overview","url":"/d/etcd-overview?${__url_time_range}"}]                                                                               },
              { "id":"thresholds","value":{"mode":"absolute","steps":[{"color":"text","value":0},{"color":"#b783af","value":0.5},{"color":"red","value":0.66666},{"color":"#5b9cd5","value":1}]} },{ "id":"decimals"  ,"value":0                                                                                                                                                      },
              { "id":"mappings"  ,"value":[{"options":{"0":{"color":"text","index":1,"text":"Dead"},"1":{"color":"#5b9cd5","index":0,"text":"Healthy"}},"type":"value"}]                         }
            ]
          },
          {"matcher":{"id":"byFrameRefID","options":"E"},"properties":[{"id":"color","value":{"fixedColor":"#d0475799","mode":"fixed"}},{"id":"links","value":[{"title":"Minio Overview","url":"/d/minio-overview?${__url_time_range}"}]}]},
          {"matcher":{"id":"byFrameRefID","options":"R"},"properties":[{"id":"color","value":{"fixedColor":"#6986a3","mode":"fixed"}},{"id":"unit","value":"tps"},{"id":"decimals","value":0},{"id":"links","value":[{"title":"PGRDS Cluster : ${__field.labels.cls}","url":"/d/pgrds-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"}]}]}
        ]
      },
      "gridPos":{"h":14,"w":8,"x":0,"y":7},
      "id":142,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","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":"cls:pressure1{job=\"pgsql\"}"                                                                                           ,"hide":false,"interval":"","legendFormat":"{{ cls }}","range":true,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:cls:xact_commit_rate1m{job=\"pgrds\"}"                                                                               ,"hide":false,"interval":"","legendFormat":"{{ cls }}","range":true,"refId":"R" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum(etcd_server_id{job=\"etcd\", cls=\"etcd\"}) by (cls) / count(etcd_server_id{job=\"etcd\", cls=\"etcd\"}) by (cls)\n","hide":false,"interval":"","legendFormat":"{{ cls }}","range":true,"refId":"D" }
      ],
      "title":"Clusters",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Blue = PostgreSQL\n\nGreen = Pgbouncer\n\nAzure = Patroni\n\nPurple = Postgres Exporter\n\nDeep Purple = Pgbouncer Exporter\n\nGray = Pgbackrest Exporter\n\nOrange = PG VIP",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"links":[],"mappings":[{"options":{"match":"null+nan","result":{"index":0,"text":"No Instances"}},"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":"#13212fd6","value":0},{"color":"#346f36cc","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 Patroni : ${__field.labels.cls}","url":"/d/pgsql-patroni?var-cls=${__field.labels.cls}&${__url_time_range}"}]}]           },
          { "matcher":{"id":"byFrameRefID","options":"V"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#1c151b","value":0},{"color":"#f79f64","value":1}]}},{"id":"links","value":[{"title":"PGSQL VIP : ${__field.labels.vip}","url":"/d/node-vip?var-vip=${__field.labels.vip}&${__url_time_range}"}]}]                 },
          { "matcher":{"id":"byFrameRefID","options":"R"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#252f34","value":0},{"color":"#6a8d9d","value":1}]}},{"id":"links","value":[{"title":"PGRDS Instance : ${__field.labels.ins}","url":"/d/pgrds-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}]      },
          { "matcher":{"id":"byFrameRefID","options":"D"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#24292e","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":"#24292e","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":"S"},"properties":[{"id":"links","value":[{"title":"PGSQL Backup : ${__field.labels.cls}","url":"/d/pgsql-pitr?var-cls=${__field.labels.cls}&${__url_time_range}"}]},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#252f34","value":0},{"color":"#42606b","value":1}]}}]            }
        ]
      },
      "gridPos":{"h":14,"w":16,"x":8,"y":7},
      "id":128,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{},"textMode":"name","wideLayout":true},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" min by (ins) (pg_up{job=\"pgsql\"})"                   ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins) (pg_up{job=\"pgrds\"})"                    ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"R" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" min by (ins) (pgbouncer_up{job=\"pgsql\"})"            ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":" patroni_up{job=\"pgsql\"}"                             ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_exporter_up{job=\"pgsql\"}"                          ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pgbouncer_exporter_up{job=\"pgsql\"}"                   ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pgbackrest_exporter_agent_up{job=\"pgsql\"}"            ,"hide":false,"instant":true,"interval":"","legendFormat":"{{ ins }}"            ,"refId":"S" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (job,cls,vip) (probe_success{job=\"pgsql-vip\"})","hide":false,"instant":true,"interval":"","legendFormat":"{{ cls }} @ {{ vip }}","refId":"V" }
      ],
      "title":"Instances",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"decimals":0,"links":[],"mappings":[],"max":1,"min":0,"noValue":"OK","thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#fcdb72","value":1},{"color":"#f79f64","value":4},{"color":"#b783af","value":8},{"color":"text","value":16}]},"unit":"none"},
        "overrides":[{"matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"links","value":[{"targetBlank":true,"title":"Pigsty Alertmanager","url":"/alertmgr/"}]}]},{"matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"links","value":[{"title":"PGSQL Alert","url":"/d/pgsql-alert?${__url_time_range}"}]}]}]
      },
      "gridPos":{"h":6,"w":4,"x":0,"y":21},
      "id":118,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"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":"count(ALERTS{alertstate=\"firing\", job=~\"pgsql|pgrds\"}) or on() vector(0)",            "interval":"","legendFormat":"Firing Alert" ,"range":true,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"count(ALERTS{alertstate=\"pending\", job=~\"pgsql|pgrds\"})"                 ,"hide":true,"interval":"","legendFormat":"Pending Alert","range":true,"refId":"B" }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":0,
          "links":[{"targetBlank":true,"title":"AlertInfo ${__field.labels.alertname}","url":"/alertmgr/#/alerts?filter=%7Balertname%3D%22${__field.labels.alertname}%22%7D"}],
          "mappings":[],
          "max":1,
          "min":0,
          "noValue":"OK",
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#fcdb72","value":1},{"color":"#f79f64","value":2},{"color":"#b783af","value":4}]},
          "unit":"none"
        },
        "overrides":[]
      },
      "gridPos":{"h":6,"w":4,"x":4,"y":21},
      "id":119,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"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":"count(ALERTS{alertstate=\"firing\", job=~\"pgsql|pgrds\"}) by (alertname, severity)","interval":"","legendFormat":"{{ alertname }}","range":true,"refId":"A"}],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "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 Cluster ${__field.labels.cls}","url":"/alertmgr/#/alerts?filter=%7Bcls%3D%22${__field.labels.cls}%22%2C%20alertname%3D%22${__field.labels.alertname}%22%7D"       },
            { "targetBlank":true,"title":"Silence ${__field.labels.alertname} on Cluster ${__field.labels.cls}"  ,"url":"/alertmgr/#/silences/new?filter=%7Bcls%3D%22${__field.labels.cls}%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}&viewPanel=78&${__url_time_range}"                                            }
          ],
          "mappings":[],
          "min":0,
          "noValue":"No Alert",
          "thresholds":{"mode":"absolute","steps":[{"color":"green","value":0}]},
          "unit":"none"
        },
        "overrides":[{"matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"custom.fillOpacity","value":66}]},{"matcher":{"id":"byType","options":"time"},"properties":[{"id":"custom.axisPlacement","value":"auto"}]},{"matcher":{"id":"byName","options":"Alert"},"properties":[{"id":"color","value":{"fixedColor":"red","mode":"fixed"}}]}]
      },
      "gridPos":{"h":6,"w":16,"x":8,"y":21},
      "id":90,
      "options":{"legend":{"calcs":["last"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.3.1",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum without (ins,instance,datname) (ALERTS{alertstate=\"firing\", job=~\"pgsql|pgrds\"})",             "interval":"","legendFormat":"[{{ severity }}] {{ alertname }} @ {{ cls }}","range":true,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"0"                                                                                       ,"hide":false,"interval":"","legendFormat":"Alert"                                       ,             "refId":"C" }
      ],
      "title":"Firing Alerts",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"PostgreSQL Cluster Load 5\nLoad = active session time / total cpu time, among the cluster, average in last 5 minute",
      "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":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":1,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"auto",
            "showValues":false,
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"area"}
          },
          "links":[{"title":"PGSQL Cluster ${__field.labels.cls}","url":"/d/pgsql-cluster?var-cls=${__field.labels.cls}&${__url_time_range}"}],
          "mappings":[{"options":{"-1":{"color":"gray","index":1,"text":"N/A"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"No Data"}},"type":"special"}],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"green","value":0.1},{"color":"yellow","value":0.3},{"color":"orange","value":0.5},{"color":"red","value":0.7},{"color":"purple","value":0.9},{"color":"text","value":1}]},
          "unit":"percentunit"
        },
        "overrides":[]
      },
      "gridPos":{"h":6,"w":8,"x":0,"y":27},
      "id":88,
      "options":{"legend":{"calcs":["last"],"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":"pg:cls:load5{job=\"$job\"} != -1","interval":"","legendFormat":"{{ cls }}","range":true,"refId":"A"}],
      "title":"Cluster Std Load5",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Transactions committed + rollback per second in last 1 minute for all 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":2,
            "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":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc","value":0}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"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":"links","value":[{"title":"PGRDS Instance : ${__field.labels.ins}","url":"/d/pgrds-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}]}] }
        ]
      },
      "gridPos":{"h":6,"w":16,"x":8,"y":27},
      "id":144,
      "options":{"legend":{"calcs":["mean"],"displayMode":"table","placement":"right","showLegend":true,"sortBy":"Mean","sortDesc":true},"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:xact_total_rate5m{job=~\"pgrds\"}","hide":false,"interval":"","intervalFactor":1,"legendFormat":"{{ ins }}","range":true,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg:ins:xact_total_rate5m{job=~\"pgsql\"}","hide":false,"interval":"","intervalFactor":1,"legendFormat":"{{ ins }}","range":true,"refId":"B" }
      ],
      "title":"Instance TPS",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":33},"id":117,"panels":[],"title":"Instances","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"All postgresql instances in this pigsty deployment",
      "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}"}]}]},
          {"matcher":{"id":"byName","options":"IP"},"properties":[{"id":"custom.width","value":110},{"id":"links","value":[{"title":"PGSQL Node for ${__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":1,"text":"primary"},"1":{"color":"#346f36cc","index":0,"text":"replica"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":2}},"type":"special"}] },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                       },
              { "id":"links"             ,"value":[{"title":"PGSQL Service for ${cls}-${__data.fields.Status}","url":"/d/pgsql-service?var-svc=${__data.fields.Cluster}-${__data.fields.Status}&${__url_time_range}"}]                                                                },
              { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                                                }
            ]
          },{
            "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":"#80808080","index":0,"text":"N/A"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"transparent","index":1}},"type":"special"}]                                                                        }
            ]
          },
          {"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}"}]},{"id":"custom.filterable","value":true}]},
          {
            "matcher":{"id":"byName","options":"Space"},
            "properties":[
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"gauge"}                                                                                                                                                                                                                         },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f","value":0},{"color":"#346f36cc","value":0.05},{"color":"#fcdb72","value":0.8},{"color":"#f79f64","value":0.85},{"color":"red","value":0.9},{"color":"#b783af","value":0.95},{"color":"text","value":0.99}]} },
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                                              },
              { "id":"custom.width"      ,"value":120                                                                                                                                                                                                                                                        },
              { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                                          }
            ]
          },{
            "matcher":{"id":"byName","options":"Proxy"},
            "properties":[
              { "id":"custom.width"      ,"value":60                                                                                                                                                                                                                           },
              { "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":"Core"},"properties":[{"id":"custom.width","value":60}]},
          {
            "matcher":{"id":"byName","options":"CPU%"},
            "properties":[
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                                        },
              { "id":"custom.width"      ,"value":120                                                                                                                                                                                                                                                  },
              { "id":"color"                                                                                                                                                                                                                                                                           },
              { "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":"custom.cellOptions","value":{"mode":"gradient","type":"gauge"}                                                                                                                                                                                                                   }
            ]
          },
          {"matcher":{"id":"byName","options":"Alive"},"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"}},{"id":"custom.filterable","value":true}]},
          {"matcher":{"id":"byRegexp","options":"/PGB? Conn/"},"properties":[{"id":"custom.width","value":90}]},{"matcher":{"id":"byName","options":"ClusterID"},"properties":[{"id":"custom.width","value":180}]},{"matcher":{"id":"byName","options":"Libraries"},"properties":[{"id":"custom.align","value":"left"},{"id":"custom.cellOptions","value":{"type":"json-view"}}]},
          {"matcher":{"id":"byName","options":"Ver"},"properties":[{"id":"custom.align","value":"center"},{"id":"custom.width","value":45},{"id":"mappings","value":[{"options":{"pattern":"(\\d+\\.\\d+).*","result":{"index":0,"text":"$1"}},"type":"regex"}]}]},
          {
            "matcher":{"id":"byName","options":"Kernel"},
            "properties":[
              {"id":"custom.width","value":110},
              {
                "id":"mappings",
                "value":[
                  { "options":{"pattern":"PostgreSQL.*Percona.*","result":{"color":"#E55400","index":0,"text":"Percona"}},"type":"regex" },{ "options":{"pattern":".*wiltondb.*","result":{"color":"#d82024e3","index":1,"text":"Babelfish"}}     ,"type":"regex" },{ "options":{"pattern":".*PolarDB.*","result":{"color":"#f25009","index":2,"text":"PolarDB"}}          ,"type":"regex" },
                  { "options":{"pattern":".*IvorySQL.*","result":{"color":"#ee9832","index":3,"text":"IvorySQL"}}        ,"type":"regex" },{ "options":{"pattern":"PostgreSQL.*","result":{"color":"#3e668f","index":4,"text":"PostgreSQL"}}      ,"type":"regex" },{ "options":{"pattern":"openHalo.*","result":{"color":"#ba5bb8","index":5,"text":"OpenHalo"}}          ,"type":"regex" },
                  { "options":{"pattern":"OrioleDB.*","result":{"color":"#1f4085","index":6,"text":"OrioleDB"}}          ,"type":"regex" }
                ]
              },
              {"id":"color"},{"id":"custom.cellOptions","value":{"type":"color-background"}}
            ]
          },{
            "matcher":{"id":"byName","options":"Mem"},
            "properties":[
              {
                "id":"thresholds",
                "value":{
                  "mode":"absolute",
                  "steps":[{"color":"#b3b5b7","value":0},{"color":"super-light-blue","value":1},{"color":"#3275d9c4","value":2},{"color":"dark-blue","value":4},{"color":"#346f36cc","value":8},{"color":"#346f36cc","value":16},{"color":"dark-green","value":32},{"color":"#fcdb72","value":62},{"color":"super-light-orange","value":64},{"color":"#f79f64","value":128},{"color":"#e02f44bf","value":256},{"color":"red","value":512}]
                }
              },
              {"id":"unit","value":"gbytes"},{"id":"custom.width","value":70},{"id":"decimals","value":0},{"id":"custom.cellOptions","value":{"type":"color-background"}},{"id":"mappings","value":[{"options":{"match":"null+nan","result":{"color":"transparent","index":0}},"type":"special"}]}
            ]
          },{
            "matcher":{"id":"byName","options":"Disk"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                                                                                                        },
              { "id":"unit"              ,"value":"gbytes"                                                                                                                                                                                                                                                                                  },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"super-light-blue","value":0},{"color":"#3e668f","value":32},{"color":"super-light-green","value":256},{"color":"#346f36cc","value":512},{"color":"light-yellow","value":1024},{"color":"#f79f64","value":4096},{"color":"light-red","value":8192}]} },
              { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                                                                         },
              { "id":"custom.cellOptions","value":{"type":"color-background"}                                                                                                                                                                                                                                                               },
              { "id":"mappings"          ,"value":[{"options":{"match":"null+nan","result":{"color":"transparent","index":1}},"type":"special"}]                                                                                                                                                                                            }
            ]
          }
        ]
      },
      "gridPos":{"h":12,"w":17,"x":0,"y":34},
      "id":70,
      "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 (cls,ins,ip) (up{job=\"$job\"})"                                                             ,"format":"table",             "instant":true,"interval":"","legendFormat":"","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:load1{job=\"$job\"})"                                                          ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:space_usage{job=\"$job\"})  / 1073741824"                                      ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:cpu_usage{job=\"$job\"})"                                                      ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:cpu_count{job=\"$job\"})"                                                      ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"F" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins) (pg_in_recovery{job=\"$job\"})"                                                        ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"G" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:num_backends{job=\"$job\"})"                                                   ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"H" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pgbouncer:ins:active_clients{job=\"$job\", proxy!=\"stats\"})"                        ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"I" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins,instance) (haproxy_backend_current_sessions{proxy!=\"stats\"})"                         ,"format":"table","hide":true ,"instant":true,"interval":"","legendFormat":"","refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"group by (ins,cluster_id,extensions,version,ver_str) (pg_meta_info{job=\"$job\", proxy!=\"stats\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"M" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:mem_size{job=\"$job\"}) / 1073741824"                                          ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"J" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:fs_size{job=\"$job\"}) / 1073741824"                                           ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"K" }
      ],
      "title":"PGSQL Instances",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"ins"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{
              "Time":true,
              "Time 1":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 #A":false,
              "Value #B":false,
              "Value #J":false,
              "Value #M":true,
              "__name__":true,
              "__name__ 1":true,
              "__name__ 2":true,
              "__name__ 3":true,
              "__name__ 4":true,
              "__name__ 5":true,
              "__name__ 6":true,
              "cls":false,
              "cls 1":false,
              "cls 2":true,
              "cls 3":true,
              "cls 4":true,
              "cls 5":true,
              "cls 6":true,
              "instance":true,
              "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,
              "job":true,
              "job 1":true,
              "job 2":true,
              "job 3":true,
              "job 4":true,
              "job 5":true,
              "job 6":true
            },
            "includeByName":{},
            "indexByName":{"Time 1":14,"Time 10":26,"Time 2":15,"Time 3":16,"Time 4":17,"Time 5":18,"Time 6":19,"Time 7":20,"Time 8":21,"Time 9":25,"Value #A":1,"Value #B":8,"Value #C":11,"Value #E":9,"Value #F":6,"Value #G":2,"Value #H":12,"Value #J":7,"Value #K":10,"Value #M":24,"cls":5,"cluster_id":22,"extensions":23,"ins":4,"ip":3,"ver_str":0,"version":13},
            "renameByName":{
              "Time 10":"",
              "Time 4":"",
              "Value #A":"Alive",
              "Value #B":"Load%",
              "Value #C":"Space",
              "Value #D":"LB Conn",
              "Value #E":"CPU%",
              "Value #F":"Core",
              "Value #G":"Role",
              "Value #H":"PG Conn",
              "Value #I":"PGB Conn",
              "Value #J":"Mem",
              "Value #K":"Disk",
              "cls":"Cluster",
              "cls 1":"Cluster",
              "cluster_id":"ClusterID",
              "extensions":"Libraries",
              "ins":"Instance",
              "instance":"",
              "instance 2":"HAProxy",
              "instance 6":"",
              "ip":"IP",
              "ip 1":"IP",
              "ver_str":"Kernel",
              "version":"Ver"
            }
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "decimals":2,
          "links":[{"title":"PGSQL Instance: ${__field.labels.ins}","url":"/d/pgsql-instance?var-ins=${__field.labels.ins}&${__url_time_range}"}],
          "mappings":[{"options":{"-1":{"color":"gray","index":1,"text":"N/A"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"No Data"}},"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":[{"matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"color","value":{"fixedColor":"#cc4637d9","mode":"fixed"}},{"id":"mappings","value":[{"options":{"0":{"color":"#cc4637d9","index":0,"text":"Fail"}},"type":"value"}]}]}]
      },
      "gridPos":{"h":22,"w":7,"x":17,"y":34},
      "id":130,
      "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{job=\"$job\"}"         ,             "interval":"",               "legendFormat":"{{ ins }}","range":true ,"refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins) (up{job=\"$job\"}) == 0","hide":false,"interval":"","instant":true,"legendFormat":"{{ ins }}","range":false,"refId":"B" }
      ],
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Patroni responsible for Postgres HA\n\nDCS Seen: time since last seen etcd\n\nPaused: is in maintenance mode? (auto failover disabled)\n \nRestart: is there any pending config change that requires restart?\n\nFailsafe: in case of DCS failure, the failsafe mode is enabled to avoid split brain\n\nLock: if failsafe is active, the cluster is locked to prevent any failover\n\nPostgres: the status of it's managed Postgres instance",
      "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 Patroni Cluster: ${__data.fields.Cluster}","url":"/d/pgsql-patroni?var-cls=${__data.fields.Cluster}&${__url_time_range}"}]},{"id":"custom.minWidth","value":120},{"id":"custom.filterable","value":true}]},
          {"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},{"id":"custom.filterable","value":true}]},
          {
            "matcher":{"id":"byName","options":"Role"},
            "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"}                                                                                                                                                                                                                                                              },
              { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                                                                                                                       }
            ]
          },
          {"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"}},{"id":"custom.filterable","value":true}]},
          {"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}"}]}]}
        ]
      },
      "gridPos":{"h":10,"w":17,"x":0,"y":46},
      "id":133,
      "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":"max by (ins,cls,ip) (patroni_up{})"                                          ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"L" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (patroni_primary{}) + \nmax by (ins) (patroni_standby_leader{})","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{})"                                  ,"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{})"                            ,"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{})"                                          ,"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{})"                                   ,"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{})"                                    ,"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{})"                            ,"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{})"                                        ,"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{})"                                   ,"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{})"                             ,"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{})"                     ,"format":"table","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"K" }
      ],
      "title":"Patroni Members",
      "transformations":[
        {"id":"joinByField","options":{"byField":"ins","mode":"outer"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"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":false,"cls 2":true,"scope":false},
            "indexByName":{"Time 1":17,"Time 10":26,"Time 11":27,"Time 12":28,"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":1,"Value #B":15,"Value #C":16,"Value #D":8,"Value #E":9,"Value #F":10,"Value #G":11,"Value #H":12,"Value #I":13,"Value #J":7,"Value #K":14,"Value #L":0,"cls 1":3,"cls 2":4,"ins":5,"ip":6,"scope":2},
            "renameByName":{"Value #A":"Role","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","cls 1":"Cluster","ins":"Instance","ip":"IP","scope":"Shard"}
          }
        }
      ],
      "type":"table"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":56},
      "id":121,
      "panels":[
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"links":[{"title":"ETCD Overview","url":"/d/etcd-overview?${__url_time_range}"}],"mappings":[],"noValue":"N/A","thresholds":{"mode":"absolute","steps":[{"color":"red"}]},"unit":"none"},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"ETCD Health"},
                "properties":[
                  {
                    "id":"mappings",
                    "value":[
                      { "options":{"0":{"color":"#b783af","index":0,"text":"All Dead"},"1":{"color":"#346f36cc","index":1,"text":"Healthy"}},"type":"value"   },{ "options":{"match":"null+nan","result":{"color":"#b783af","index":2,"text":"Unknown"}}                              ,"type":"special" },
                      { "options":{"from":0.49999,"result":{"color":"#cc4637d9","index":3,"text":"1 / 2"},"to":0.50001}                     ,"type":"range"   },{ "options":{"from":0.66666,"result":{"color":"#f79f64","index":4,"text":"2 / 3"},"to":0.66667}                       ,"type":"range"   },
                      { "options":{"from":0.33333,"result":{"color":"#b783af","index":5,"text":"1 / 3"},"to":0.33334}                       ,"type":"range"   }
                    ]
                  },
                  {"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#b783af"},{"color":"#cc4637d9","value":0.5},{"color":"#f79f64","value":0.66},{"color":"#346f36cc","value":1}]}},{"id":"unit","value":"percentunit"},{"id":"decimals","value":0}
                ]
              },
              {"matcher":{"id":"byName","options":"Failsafe Active"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#cc4637d9","value":1}]}},{"id":"mappings","value":[{"options":{"0":{"index":0,"text":"Healthy"}},"type":"value"}]},{"id":"unit","value":"Cluster"}]}
            ]
          },
          "gridPos":{"h":14,"w":4,"x":0,"y":71},
          "id":126,
          "maxDataPoints":100,
          "options":{"colorMode":"background","graphMode":"none","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["last"],"fields":"","values":false},"showPercentChange":false,"textMode":"auto","wideLayout":true},
          "pluginVersion":"12.0.2",
          "targets":[
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum(etcd_server_id{job=\"etcd\", cls=\"etcd\"}) by (cls) /\n count(etcd_server_id{job=\"etcd\", cls=\"etcd\"}) by (cls)\nor on() vector(0)","format":"time_series",             "instant":true,"intervalFactor":2,"legendFormat":"ETCD Health"    ,"range":false,"refId":"A","step":600 },
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum(patroni_failsafe_mode_is_active{})"                                                                                                    ,"format":"time_series","hide":false,"instant":true,"intervalFactor":2,"legendFormat":"Failsafe Active","range":false,"refId":"B","step":600 }
          ],
          "type":"stat"
        },
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "description":"etcd is the DCS used by patroni",
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"custom":{"axisPlacement":"auto","fillOpacity":70,"hideFrom":{"legend":false,"tooltip":false,"viz":false},"insertNulls":false,"lineWidth":0,"spanNulls":false},"decimals":0,"mappings":[],"min":-1,"thresholds":{"mode":"absolute","steps":[{"color":"#cc4637d9"},{"color":"#346f36cc","value":1}]}},
            "overrides":[{"matcher":{"id":"byName","options":"ETCD Cluster Healthy"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#cc4637d9"},{"color":"#3e668f","value":1}]}}]}]
          },
          "gridPos":{"h":7,"w":13,"x":4,"y":71},
          "id":125,
          "links":[{"title":"ETCD Overview","url":"/d/etcd-overview?${__url_time_range}"}],
          "options":{"alignValue":"left","legend":{"displayMode":"list","placement":"bottom","showLegend":false},"mergeValues":true,"rowHeight":0.96,"showValue":"never","tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
          "pluginVersion":"12.0.2",
          "targets":[
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","expr":"min(etcd_server_has_leader{job=\"etcd\", cls=\"etcd\"}) or on() vector(0)","hide":false,"legendFormat":"ETCD Cluster Healthy","range":true,"refId":"D" },
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","expr":"up{job=\"etcd\", cls=\"etcd\"}"                                           ,             "legendFormat":"{{ ins }} @ {{ ip }}","range":true,"refId":"A" }
          ],
          "title":"ETCD Aliveness",
          "type":"state-timeline"
        },
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "description":"How long since patroni the HA agent successfully connect to DCS:etcd.\nMax amoung cluster\n\nvalue larger than 20s needs extra attention",
          "fieldConfig":{
            "defaults":{"color":{"mode":"thresholds"},"decimals":1,"links":[{"title":"PGSQL Patroni : ${__field.labels.cls}","url":"/d/pgsql-patroni?var-cls=${__field.labels.cls}&${__url_time_range}"}],"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
            "overrides":[{"matcher":{"id":"byName","options":"Value"},"properties":[{"id":"unit","value":"s"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#346f36cc","value":1},{"color":"#f79f64","value":20},{"color":"red","value":30},{"color":"#b783af","value":60},{"color":"text","value":300}]}}]}]
          },
          "gridPos":{"h":14,"w":7,"x":17,"y":71},
          "id":122,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"textMode":"auto","wideLayout":true},
          "pluginVersion":"12.0.2",
          "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (cls) (time() - patroni_dcs_last_seen{job=\"$job\"})","format":"time_series","hide":false,"instant":true,"legendFormat":"__auto","range":false,"refId":"J"}],
          "title":"DCS Last Seen",
          "type":"stat"
        },
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "description":"Time since patroni last successful connect to DCS:etcd service",
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{
                "axisBorderShow":false,
                "axisCenteredZero":false,
                "axisColorMode":"text",
                "axisLabel":"",
                "axisPlacement":"auto",
                "barAlignment":0,
                "barWidthFactor":0.6,
                "drawStyle":"line",
                "fillOpacity":1,
                "gradientMode":"none",
                "hideFrom":{"legend":false,"tooltip":false,"viz":false},
                "insertNulls":false,
                "lineInterpolation":"stepBefore",
                "lineWidth":1,
                "pointSize":4,
                "scaleDistribution":{"type":"linear"},
                "showPoints":"auto",
                "spanNulls":false,
                "stacking":{"group":"A","mode":"none"},
                "thresholdsStyle":{"mode":"dashed+area"}
              },
              "mappings":[],
              "thresholds":{"mode":"absolute","steps":[{"color":"green"},{"color":"orange","value":20},{"color":"red","value":30},{"color":"purple","value":60},{"color":"text","value":300}]},
              "unit":"s"
            },
            "overrides":[]
          },
          "gridPos":{"h":7,"w":13,"x":4,"y":78},
          "id":146,
          "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
          "pluginVersion":"12.0.2",
          "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","expr":"max by (cls) (time() - patroni_dcs_last_seen{job=\"$job\"})","instant":false,"legendFormat":"{{ ins }}","range":true,"refId":"A"}],
          "title":"Patroni DCS Last Seen",
          "type":"timeseries"
        }
      ],
      "title":"DCS: etcd",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":57},
      "id":108,
      "panels":[
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{
                "axisCenteredZero":false,
                "axisColorMode":"text",
                "axisLabel":"",
                "axisPlacement":"auto",
                "barAlignment":0,
                "drawStyle":"line",
                "fillOpacity":0,
                "gradientMode":"none",
                "hideFrom":{"legend":false,"tooltip":false,"viz":false},
                "insertNulls":false,
                "lineInterpolation":"stepBefore",
                "lineWidth":1,
                "pointSize":5,
                "scaleDistribution":{"type":"linear"},
                "showPoints":"never",
                "spanNulls":false,
                "stacking":{"group":"A","mode":"none"},
                "thresholdsStyle":{"mode":"off"}
              },
              "links":[{"title":"PGSQL Service : ${__field.labels.proxy}","url":"/d/pgsql-service?var-svc=${__field.labels.proxy}&${__url_time_range}"}],
              "mappings":[{"options":{"match":"null+nan","result":{"color":"#808080","index":1}},"type":"special"}],
              "thresholds":{"mode":"absolute","steps":[{"color":"#cc4637d9"},{"color":"#346f36cc","value":1}]}
            },
            "overrides":[]
          },
          "gridPos":{"h":6,"w":24,"x":0,"y":188},
          "id":136,
          "options":{"legend":{"calcs":["max","last"],"displayMode":"table","placement":"right","showLegend":true,"sortBy":"Max","sortDesc":true},"tooltip":{"mode":"single","sort":"none"}},
          "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","expr":"sum by (cls,proxy) (haproxy_backend_current_sessions{proxy!=\"stats\"})","instant":false,"legendFormat":"{{ proxy }}","range":true,"refId":"A"}],
          "title":"Service Session",
          "type":"timeseries"
        },{
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"thresholds"},
              "custom":{"fillOpacity":60,"hideFrom":{"legend":false,"tooltip":false,"viz":false},"insertNulls":false,"lineWidth":0,"spanNulls":false},
              "links":[{"title":"PGSQL Service : ${__field.labels.proxy}","url":"/d/pgsql-service?var-svc=${__field.labels.proxy}&${__url_time_range}"}],
              "mappings":[{"options":{"match":"null+nan","result":{"color":"#808080","index":1}},"type":"special"}],
              "thresholds":{"mode":"absolute","steps":[{"color":"#cc4637d9"},{"color":"#346f36cc","value":1}]}
            },
            "overrides":[]
          },
          "gridPos":{"h":17,"w":24,"x":0,"y":194},
          "id":135,
          "options":{"alignValue":"left","legend":{"displayMode":"list","placement":"bottom","showLegend":false},"mergeValues":true,"rowHeight":0.9,"showValue":"never","tooltip":{"mode":"single","sort":"none"}},
          "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","expr":"sum by (cls,proxy) (haproxy_server_status{state=\"UP\"}) > bool 0","instant":false,"legendFormat":"{{ proxy }}","range":true,"refId":"A"}],
          "title":"Service Health",
          "type":"state-timeline"
        },{
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "description":"Services SLI is measured by Average Service UP time of last 1 day",
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"thresholds"},
              "decimals":4,
              "links":[{"title":"PGSQL Service : ${__field.labels.proxy}","url":"/d/pgsql-service?var-svc=${__field.labels.proxy}&${__url_time_range}"}],
              "mappings":[],
              "thresholds":{"mode":"absolute","steps":[{"color":"text"},{"color":"#7771a4","value":0.9},{"color":"#b783af","value":0.95},{"color":"#cc4637d9","value":0.99},{"color":"#f79f64","value":0.999},{"color":"#fcdb72","value":0.9999},{"color":"#3e668f","value":0.99999},{"color":"#346f36cc","value":1}]},
              "unit":"percentunit"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":24,"x":0,"y":211},
          "id":141,
          "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"auto","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"textMode":"value_and_name"},
          "pluginVersion":"10.1.5",
          "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"avg_over_time(haproxy:cls:service_up{}[1d])","instant":true,"legendFormat":"{{ proxy }}","range":false,"refId":"A"}],
          "type":"stat"
        }
      ],
      "title":"Services",
      "type":"row"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":58},
      "id":134,
      "panels":[
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "description":"Database of this cluster ${cls}",
          "fieldConfig":{
            "defaults":{"color":{"mode":"fixed"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
            "overrides":[
              {
                "matcher":{"id":"byName","options":"Database"},
                "properties":[
                  { "id":"links"             ,"value":[{"title":"PGSQL Database : ${__data.fields.Instance}.${__data.fields.Database}","url":"/d/pgsql-database?var-ins=${__data.fields.Instance}&var-datname=${__data.fields.Database}&${__url_time_range}"}] },
                  { "id":"mappings"          ,"value":[{"options":{"postgres":{"color":"#3e668f","index":2},"template0":{"color":"#f79f64","index":0},"template1":{"color":"#fcdb72","index":1}},"type":"value"}]                                              },
                  { "id":"custom.cellOptions","value":{"type":"auto"}                                                                                                                                                                                          },
                  { "id":"color"             ,"value":{"fixedColor":"text","mode":"fixed"}                                                                                                                                                                     },
                  { "id":"custom.minWidth"   ,"value":120                                                                                                                                                                                                      },
                  { "id":"custom.filterable" ,"value":true                                                                                                                                                                                                     }
                ]
              },{
                "matcher":{"id":"byName","options":"Size"},
                "properties":[
                  { "id":"custom.width"      ,"value":80                                                                                                                                                                              },
                  { "id":"unit"              ,"value":"decbytes"                                                                                                                                                                      },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"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":1                                                                                                                                                                               }
                ]
              },{
                "matcher":{"id":"byName","options":"Age"},
                "properties":[
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":60000000},{"color":"#EAB839","value":200000000},{"color":"#f79f64","value":600000000},{"color":"red","value":1000000000},{"color":"#b783af","value":2000000000},{"color":"text","value":2137483647}]} },
                  { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                                                              },
                  { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                                                                      },
                  { "id":"custom.width"      ,"value":60                                                                                                                                                                                                                                                                                 },
                  { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                                                              },
                  { "id":"decimals"          ,"value":2                                                                                                                                                                                                                                                                                  }
                ]
              },
              {"matcher":{"id":"byName","options":"TPS"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#f79f64","value":30000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}},{"id":"custom.width","value":55},{"id":"color","value":{"mode":"thresholds"}},{"id":"decimals","value":1}]},
              {
                "matcher":{"id":"byName","options":"Status"},
                "properties":[
                  { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                                                                                                                                   },
                  { "id":"mappings"          ,"value":[{"options":{"0":{"color":"#505050d4","index":1,"text":"Template0"},"1":{"color":"text","index":2,"text":"RejectConn"},"2":{"color":"#818181c4","index":3,"text":"Template"},"3":{"color":"#346f36cc","index":4,"text":"Normal"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"N/A"}},"type":"special"}] },
                  { "id":"custom.cellOptions","value":{"mode":"basic","type":"color-background"}                                                                                                                                                                                                                                                                                                            }
                ]
              },{
                "matcher":{"id":"byName","options":"Session"},
                "properties":[
                  { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                             },
                  { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"transparent"},{"color":"#3e668f","value":1},{"color":"#346f36cc","value":10},{"color":"#f79f64","value":40},{"color":"#cc4637d9","value":80},{"color":"#b783af","value":100},{"color":"text","value":400}]} },
                  { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                             },
                  { "id":"custom.width"      ,"value":70                                                                                                                                                                                                                                                },
                  { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                                                                                                                     }
                ]
              },{
                "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":"byName","options":"Instance"},"properties":[{"id":"custom.minWidth","value":150},{"id":"links","value":[{"title":"PGSQL Instance : ${__data.fields.Instance}","url":"/d/pgsql-instance?var-ins=${__data.fields.Instance}&${__url_time_range}"}]},{"id":"custom.filterable","value":true}]},
              {"matcher":{"id":"byName","options":"Catalog"},"properties":[{"id":"custom.minWidth","value":100},{"id":"links","value":[{"title":"PGCAT Database : ${__data.fields.Instance}.${__data.fields.Database}","url":"/d/pgcat-database?var-dsn=${__data.fields.Instance}.${__data.fields.Database}"}]}]},
              {"matcher":{"id":"byName","options":"Cluster"},"properties":[{"id":"links","value":[{"title":"PGSQL Databases : ${cls}.${datname}","url":"/d/pgsql-databases?var-cls=${__data.fields.Cluster}&var-datname=${__data.fields.Database}"}]},{"id":"custom.minWidth","value":120},{"id":"custom.filterable","value":true}]}
            ]
          },
          "gridPos":{"h":11,"w":24,"x":0,"y":191},
          "id":140,
          "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":false,"displayName":"Database"}]},
          "pluginVersion":"10.1.5",
          "targets":[
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (cls,ins,datname) (pg_size_bytes{datname!~\"wal|log|postgres|template\\\\d\"})"       ,"format":"table",             "instant":true,"interval":"","legendFormat":"Age"       ,"refId":"A" },
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins,datname) (pg:db:age{datname!~\"wal|log|postgres|template\\\\d\"})"               ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Commit"    ,"refId":"B" },
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (ins,datname) (pg:db:xact_commit_rate1m{datname!~\"wal|log|postgres|template\\\\d\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"TPS"       ,"refId":"E" },
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins,datname) (pg_db_conn_limit{datname!~\"wal|log|postgres|template\\\\d\"})"        ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Limit","refId":"F" },
            { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (ins,datname) (pg_db_numbackends{datname!~\"wal|log|postgres|template\\\\d\"})"       ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Conn Limit","refId":"C" }
          ],
          "transformations":[
            {"id":"seriesToColumns","options":{"byField":"datname"}},
            {
              "id":"organize",
              "options":{
                "excludeByName":{"Time":true,"Time 1":true,"Time 10":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"Time 6":true,"Time 7":true,"Time 8":true,"Time 9":true,"cls 2":true,"cls 3":true,"cls 4":true,"cls 5":true,"ins 1":false,"ins 2":false,"ins 3":true,"ins 4":true,"ins 5":true},
                "indexByName":{"Time 1":9,"Time 2":10,"Time 3":11,"Time 4":12,"Time 5":13,"Value #A":5,"Value #B":6,"Value #C":4,"Value #E":7,"Value #F":8,"cls":0,"datname":2,"ins 1":1,"ins 2":3,"ins 3":14,"ins 4":15,"ins 5":16},
                "renameByName":{"Time 1":"","Time 7":"","Value #A":"Size","Value #B":"Age","Value #C":"Session","Value #D":"Session","Value #E":"TPS","Value #F":"ConnLimit","Value #G":"Reserve","Value #H":"Current","Value #I":"Disable","Value #J":"Pause","cls":"Cluster","cls 1":"Cluster","datname":"Database","host":"Target","ins 1":"Instance","ins 2":"Catalog","real_datname":"Datname"}
              }
            }
          ],
          "type":"table"
        }
      ],
      "title":"Databases",
      "type":"row"
    }
  ],
  "preload":false,
  "refresh":"",
  "schemaVersion":42,
  "tags":["Pigsty","PGSQL","Overview","HOME"],
  "templating":{"list":[{"current":{},"description":"Environment identifier (pgsql by default)","hide":2,"label":"Environment","name":"job","query":"pgsql","skipUrlSync":true,"type":"constant"}]},
  "time":{"from":"now-1h","to":"now"},
  "timepicker":{},
  "timezone":"browser",
  "title":"PGSQL Overview",
  "uid":"pgsql-overview",
  "version":1,
  "weekStart":""
}