diff --git a/group_vars/stage_prodnso/postgres.yml b/group_vars/stage_prodnso/postgres.yml index a3ccba5..ea0cda2 100644 --- a/group_vars/stage_prodnso/postgres.yml +++ b/group_vars/stage_prodnso/postgres.yml @@ -3,5 +3,5 @@ postgres_backup_volume_count: 4 postgres_backup_volume_size: 20 -postgres_pgdatadir_lvm_hcloudvol_size: 20 +postgres_pgdatadir_lvm_hcloudvol_size: 30 postgres_pgdatadir_lvm_hcloudvol_count: 4 diff --git a/templates/prometheus/config/grafana/provisioning/dashboards/PostgreSQL_Database.json b/templates/prometheus/config/grafana/provisioning/dashboards/PostgreSQL_Database.json index 018e182..3e91718 100644 --- a/templates/prometheus/config/grafana/provisioning/dashboards/PostgreSQL_Database.json +++ b/templates/prometheus/config/grafana/provisioning/dashboards/PostgreSQL_Database.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -24,12 +27,15 @@ "gnetId": 9628, "graphTooltip": 0, "id": 11, - "iteration": 1649835887945, "links": [], "liveNow": false, "panels": [ { "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "gridPos": { "h": 1, "w": 24, @@ -38,6 +44,15 @@ }, "id": 34, "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" + } + ], "title": "General Counters, CPU, Memory and File Descriptor Stats", "type": "row" }, @@ -102,9 +117,13 @@ }, "textMode": "name" }, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_static{instance=\"$instance\"}", "format": "time_series", "instant": true, @@ -178,9 +197,13 @@ }, "textMode": "auto" }, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_postmaster_start_time_seconds{instance=\"$instance\"} * 1000", "format": "time_series", "intervalFactor": 2, @@ -252,9 +275,13 @@ }, "textMode": "auto" }, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "SUM(pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"})", "format": "time_series", "intervalFactor": 2, @@ -326,9 +353,13 @@ }, "textMode": "auto" }, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "SUM(pg_stat_database_tup_inserted{datname=~\"$datname\", instance=~\"$instance\"})", "format": "time_series", "intervalFactor": 2, @@ -400,9 +431,13 @@ }, "textMode": "auto" }, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "SUM(pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"})", "format": "time_series", "intervalFactor": 2, @@ -474,9 +509,13 @@ }, "textMode": "auto" }, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_max_connections{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -530,7 +569,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -540,6 +579,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "avg(rate(process_cpu_seconds_total{instance=\"$instance\"}[5m]) * 1000)", "format": "time_series", "intervalFactor": 2, @@ -621,7 +664,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -631,6 +674,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "avg(rate(process_resident_memory_bytes{instance=\"$instance\"}[5m]))", "format": "time_series", "intervalFactor": 2, @@ -638,6 +685,10 @@ "refId": "A" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "avg(rate(process_virtual_memory_bytes{instance=\"$instance\"}[5m]))", "format": "time_series", "intervalFactor": 2, @@ -719,7 +770,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -729,6 +780,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "process_open_fds{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 2, @@ -767,12 +822,18 @@ } }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -828,10 +889,12 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -851,12 +914,18 @@ "type": "timeseries" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -912,10 +981,12 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -936,6 +1007,10 @@ }, { "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "gridPos": { "h": 1, "w": 24, @@ -969,8 +1044,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1008,6 +1082,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_shared_buffers_bytes{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1042,8 +1120,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1081,6 +1158,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_effective_cache_size_bytes{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1115,8 +1196,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1154,6 +1234,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_maintenance_work_mem_bytes{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1188,8 +1272,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1227,6 +1310,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_work_mem_bytes{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1263,8 +1350,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1302,6 +1388,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_max_wal_size_bytes{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1336,8 +1426,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1375,6 +1464,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_random_page_cost{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1409,8 +1502,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1448,6 +1540,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_seq_page_cost", "format": "time_series", "intervalFactor": 1, @@ -1482,8 +1578,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1521,6 +1616,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_max_worker_processes{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1555,8 +1654,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1594,6 +1692,10 @@ "pluginVersion": "8.3.5", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_settings_max_parallel_workers{instance=\"$instance\"}", "format": "time_series", "intervalFactor": 1, @@ -1604,11 +1706,24 @@ "type": "stat" } ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" + } + ], "title": "Settings", "type": "row" }, { "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "gridPos": { "h": 1, "w": 24, @@ -1617,104 +1732,116 @@ }, "id": 30, "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" + } + ], "title": "Database Stats", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "fieldConfig": { "defaults": { - "links": [] + "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 + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 20 }, - "hiddenSeries": false, - "id": 1, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "connected", + "id": 76, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 3, - "points": true, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=\"active\"} !=0", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{datname}}, s: {{state}}", - "refId": "A", - "step": 2 + "legend": { + "calcs": [ + "min", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "thresholds": [], - "timeRegions": [], - "title": "Active sessions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] }, - "yaxes": [ - { - "decimals": 0, - "format": "none", - "logBase": 1, - "show": true - }, + "targets": [ { - "format": "short", - "logBase": 1, - "show": true + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "pg_database_size_bytes{instance=~\"$instance\",datname=~\"$datname\"}", + "legendFormat": "{{datname}}", + "range": true, + "refId": "A" } ], - "yaxis": { - "align": false - } + "title": "database size in B ", + "type": "timeseries" }, { "aliasColors": {}, @@ -1760,7 +1887,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -1770,6 +1897,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_database_xact_commit{instance=\"$instance\", datname=~\"$datname\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -1777,6 +1908,10 @@ "refId": "A" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_database_xact_rollback{instance=\"$instance\", datname=~\"$datname\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -1860,7 +1995,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -1870,6 +2005,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"} != 0", "format": "time_series", "intervalFactor": 2, @@ -1932,31 +2071,31 @@ "y": 27 }, "hiddenSeries": false, - "id": 5, + "id": 1, "legend": { "alignAsTable": true, "avg": true, "current": true, - "max": false, + "max": true, "min": false, "rightSide": true, "show": true, "sort": "current", "sortDesc": true, - "total": true, + "total": false, "values": true }, - "lines": true, + "lines": false, "linewidth": 1, "links": [], - "nullPointMode": "null", + "nullPointMode": "connected", "options": { "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, + "pluginVersion": "9.1.5", + "pointradius": 3, + "points": true, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, @@ -1964,17 +2103,22 @@ "steppedLine": false, "targets": [ { - "expr": "pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=\"active\"} !=0", "format": "time_series", + "interval": "", "intervalFactor": 2, - "legendFormat": "{{datname}}", + "legendFormat": "{{datname}}, s: {{state}}", "refId": "A", "step": 2 } ], "thresholds": [], "timeRegions": [], - "title": "Fetch data (SELECT)", + "title": "Active sessions", "tooltip": { "shared": true, "sort": 0, @@ -1988,7 +2132,8 @@ }, "yaxes": [ { - "format": "bytes", + "decimals": 0, + "format": "none", "logBase": 1, "show": true }, @@ -2048,7 +2193,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2058,6 +2203,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_stat_database_tup_inserted{datname=~\"$datname\", instance=~\"$instance\"} != 0", "format": "time_series", "intervalFactor": 2, @@ -2144,7 +2293,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2154,6 +2303,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_locks_count{datname=~\"$datname\", instance=~\"$instance\", mode=~\"$mode\"} != 0", "format": "time_series", "intervalFactor": 2, @@ -2218,7 +2371,7 @@ "y": 34 }, "hiddenSeries": false, - "id": 14, + "id": 5, "legend": { "alignAsTable": true, "avg": true, @@ -2227,7 +2380,7 @@ "min": false, "rightSide": true, "show": true, - "sort": "total", + "sort": "current", "sortDesc": true, "total": true, "values": true @@ -2240,7 +2393,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2250,7 +2403,11 @@ "steppedLine": false, "targets": [ { - "expr": "pg_stat_database_tup_returned{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"} != 0", "format": "time_series", "intervalFactor": 2, "legendFormat": "{{datname}}", @@ -2260,7 +2417,7 @@ ], "thresholds": [], "timeRegions": [], - "title": "Return data", + "title": "Fetch data (SELECT)", "tooltip": { "shared": true, "sort": 0, @@ -2334,7 +2491,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2344,6 +2501,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=~\"idle|idle in transaction|idle in transaction (aborted)\"}", "format": "time_series", "intervalFactor": 2, @@ -2429,7 +2590,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2439,6 +2600,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "pg_stat_database_tup_deleted{datname=~\"$datname\", instance=~\"$instance\"} != 0", "format": "time_series", "intervalFactor": 2, @@ -2486,15 +2651,22 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "decimals": 2, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 41 }, - "id": 62, + "hiddenSeries": false, + "id": 14, "legend": { "alignAsTable": true, "avg": true, @@ -2503,15 +2675,20 @@ "min": false, "rightSide": true, "show": true, - "total": false, + "sort": "total", + "sortDesc": true, + "total": true, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2521,15 +2698,21 @@ "steppedLine": false, "targets": [ { - "expr": "pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"} / (pg_stat_database_blks_read{instance=\"$instance\", datname=~\"$datname\"} + pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"})", + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "pg_stat_database_tup_returned{datname=~\"$datname\", instance=~\"$instance\"} != 0", "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{ datname }}", - "refId": "A" + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 } ], "thresholds": [], - "title": "Cache Hit Rate", + "timeRegions": [], + "title": "Return data", "tooltip": { "shared": true, "sort": 0, @@ -2543,9 +2726,7 @@ }, "yaxes": [ { - "decimals": 4, - "format": "percentunit", - "label": "", + "format": "bytes", "logBase": 1, "show": true }, @@ -2569,12 +2750,14 @@ "uid": "PBFA97CFB590B2093" }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 41 }, + "hiddenSeries": false, "id": 64, "legend": { "alignAsTable": true, @@ -2591,8 +2774,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2602,6 +2788,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_buffers_backend{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2609,6 +2799,10 @@ "refId": "A" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_buffers_alloc{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2616,6 +2810,10 @@ "refId": "B" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_buffers_backend_fsync{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2623,6 +2821,10 @@ "refId": "C" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_buffers_checkpoint{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2630,6 +2832,10 @@ "refId": "D" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_buffers_clean{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2638,6 +2844,7 @@ } ], "thresholds": [], + "timeRegions": [], "title": "Buffers (bgwriter)", "tooltip": { "shared": true, @@ -2677,12 +2884,14 @@ }, "decimals": 0, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 41 }, + "hiddenSeries": false, "id": 66, "legend": { "alignAsTable": true, @@ -2699,8 +2908,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2710,6 +2922,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_database_conflicts{instance=\"$instance\", datname=~\"$datname\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2717,6 +2933,10 @@ "refId": "B" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_database_deadlocks{instance=\"$instance\", datname=~\"$datname\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2725,6 +2945,7 @@ } ], "thresholds": [], + "timeRegions": [], "title": "Conflicts/Deadlocks", "tooltip": { "shared": true, @@ -2763,15 +2984,17 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "description": "Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.", + "decimals": 2, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 48 }, - "id": 68, + "hiddenSeries": false, + "id": 62, "legend": { "alignAsTable": true, "avg": true, @@ -2780,15 +3003,18 @@ "min": false, "rightSide": true, "show": true, - "total": true, + "total": false, "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2798,15 +3024,20 @@ "steppedLine": false, "targets": [ { - "expr": "irate(pg_stat_database_temp_bytes{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"} / (pg_stat_database_blks_read{instance=\"$instance\", datname=~\"$datname\"} + pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"})", "format": "time_series", "intervalFactor": 1, - "legendFormat": "{{datname}}", + "legendFormat": "{{ datname }}", "refId": "A" } ], "thresholds": [], - "title": "Temp File (Bytes)", + "timeRegions": [], + "title": "Cache Hit Rate", "tooltip": { "shared": true, "sort": 0, @@ -2820,9 +3051,10 @@ }, "yaxes": [ { - "format": "bytes", + "decimals": 4, + "format": "percentunit", + "label": "", "logBase": 1, - "min": "0", "show": true }, { @@ -2845,12 +3077,14 @@ "uid": "PBFA97CFB590B2093" }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 16, "x": 8, "y": 48 }, + "hiddenSeries": false, "id": 70, "legend": { "alignAsTable": true, @@ -2866,8 +3100,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, - "pluginVersion": "8.3.5", + "pluginVersion": "9.1.5", "pointradius": 5, "points": false, "renderer": "flot", @@ -2877,6 +3114,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_checkpoint_write_time{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2884,6 +3125,10 @@ "refId": "B" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "expr": "irate(pg_stat_bgwriter_checkpoint_sync_time{instance=\"$instance\"}[5m])", "format": "time_series", "intervalFactor": 1, @@ -2892,6 +3137,7 @@ } ], "thresholds": [], + "timeRegions": [], "title": "Checkpoint Stats", "tooltip": { "shared": true, @@ -2919,10 +3165,101 @@ "yaxis": { "align": false } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 55 + }, + "hiddenSeries": false, + "id": 68, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.1.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "irate(pg_stat_database_temp_bytes{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Temp File (Bytes)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "logBase": 1, + "min": "0", + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } } ], "refresh": "10s", - "schemaVersion": 34, + "schemaVersion": 37, "style": "dark", "tags": [ "postgres", @@ -3010,7 +3347,7 @@ }, { "current": { - "selected": true, + "selected": false, "text": "dev-postgres-01.smardigo.digital", "value": "dev-postgres-01.smardigo.digital" }, @@ -3101,7 +3438,7 @@ ] }, "time": { - "from": "now-1h", + "from": "now-7d", "to": "now" }, "timepicker": { @@ -3132,6 +3469,6 @@ "timezone": "", "title": "PostgreSQL Database", "uid": "000000039", - "version": 1, + "version": 50, "weekStart": "" } \ No newline at end of file