diff --git a/grafana/postgresql_server_overview.json b/grafana/postgresql_server_overview.json index 23af4fb..82f53ae 100644 --- a/grafana/postgresql_server_overview.json +++ b/grafana/postgresql_server_overview.json @@ -70,6 +70,967 @@ "x": 0, "y": 0 }, + "id": 100, + "panels": [], + "title": "Settings", + "type": "row" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 0, + "y": 1 + }, + "id": 119, + "interval": null, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "name" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "exemplar": false, + "expr": "sql_server{host=~'$host',sql_job=~'$cluster',col=\"server_start_time\"}", + "instant": false, + "interval": "", + "legendFormat": "{{server_version}}", + "refId": "A" + } + ], + "title": "Version", + "transformations": [], + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 2, + "y": 1 + }, + "id": 115, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "count(count(node_cpu_seconds_total) without (mode)) without (cpu)", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "# Cores", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 4, + "y": 1 + }, + "id": 112, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "node_memory_MemTotal_bytes", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Total Memory", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 1 + }, + "id": 110, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"max_connections\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Connections", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 1 + }, + "id": 104, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"work_mem\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Work Mem", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 1 + }, + "id": 105, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"shared_buffers\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Shared Buffers", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 1 + }, + "id": 109, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"max_wal_size\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max WAL Size", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [ + { + "from": "", + "id": 1, + "text": "Off", + "to": "", + "type": 1, + "value": "0" + }, + { + "from": "", + "id": 2, + "text": "On", + "to": "", + "type": 1, + "value": "1" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 1 + }, + "id": 102, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"data_checksums\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Data Checksums", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "noValue": "N/A", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 21, + "y": 1 + }, + "id": 114, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sum by (checksum_failures) (sql_pg_stat_database{col=\"checksum_failures\",host=~'$host',sql_job=~'$cluster'})", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Checksum Failures", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "dateTimeFromNow" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 0, + "y": 4 + }, + "id": 106, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_server{col=\"server_start_time\", host=~'$host',sql_job=~'$cluster'} * 1000", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Server Start Time", + "type": "stat" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 4 + }, + "id": 120, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"max_worker_processes\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Worker Processes", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 4 + }, + "id": 107, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"maintenance_work_mem\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Maintenance Work Mem", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 4 + }, + "id": 108, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"effective_cache_size\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Effective Cache Size", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 4 + }, + "id": 111, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"checkpoint_timeout\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Checkpoint Timeout", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [ + { + "from": "", + "id": 1, + "text": "Off", + "to": "", + "type": 1, + "value": "0" + }, + { + "from": "", + "id": 2, + "text": "On", + "to": "", + "type": 1, + "value": "1" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 4 + }, + "id": 103, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "sql_settings{col=\"jit\",host=~'$host',sql_job=~'$cluster'}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "JIT", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "requested (explicit, wal or backup-based)" + }, + "properties": [ + { + "id": "displayName" + } + ] + } + ] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 21, + "y": 4 + }, + "id": 113, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.4.3", + "targets": [ + { + "expr": "node_vmstat_oom_kill", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Out-of-Memory Kills", + "type": "stat" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, "id": 69, "panels": [], "repeat": null, @@ -88,6 +1049,12 @@ "datasource": "prometheus", "decimals": 1, "description": "The CPU usage, rate over $rate_interval.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percent", "gauge": { "maxValue": 100, @@ -100,7 +1067,7 @@ "h": 6, "w": 4, "x": 0, - "y": 1 + "y": 8 }, "id": 35, "interval": null, @@ -174,6 +1141,12 @@ "datasource": "prometheus", "decimals": 1, "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percentunit", "gauge": { "maxValue": 1, @@ -186,7 +1159,7 @@ "h": 6, "w": 4, "x": 4, - "y": 1 + "y": 8 }, "id": 34, "interval": null, @@ -261,6 +1234,12 @@ "datasource": "prometheus", "decimals": 1, "description": "Shows the percentage of used storage on the most used mount.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percentunit", "gauge": { "maxValue": 1, @@ -273,7 +1252,7 @@ "h": 6, "w": 4, "x": 8, - "y": 1 + "y": 8 }, "id": 36, "interval": null, @@ -348,6 +1327,12 @@ "datasource": "prometheus", "decimals": null, "description": "Percentage of swap spaced used on system", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percentunit", "gauge": { "maxValue": 1, @@ -360,7 +1345,7 @@ "h": 6, "w": 4, "x": 12, - "y": 1 + "y": 8 }, "id": 38, "interval": null, @@ -433,6 +1418,12 @@ "datasource": "prometheus", "decimals": 2, "description": "Age of oldest XID in percent of autovacuum_max_freeze_age (default: 200 M)\n\nAt 100%, tables will be frozen by autovacuum. Values over 100% indicate autovacuum is not keeping up.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percentunit", "gauge": { "maxValue": 2, @@ -445,7 +1436,7 @@ "h": 6, "w": 4, "x": 16, - "y": 1 + "y": 8 }, "id": 39, "interval": null, @@ -518,6 +1509,12 @@ "datasource": "prometheus", "decimals": 2, "description": "The used connections in relation to the limit (reduced by superuser_reserved_connections).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percentunit", "gauge": { "maxValue": 1, @@ -530,7 +1527,7 @@ "h": 6, "w": 4, "x": 20, - "y": 1 + "y": 8 }, "id": 41, "interval": null, @@ -604,6 +1601,12 @@ "datasource": "prometheus", "decimals": 0, "description": "Number of WAL files that still need to be archived.\n\nCan grow under write load but should not increase over longer periods of time.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "none", "gauge": { "maxValue": 3000, @@ -616,7 +1619,7 @@ "h": 6, "w": 4, "x": 0, - "y": 7 + "y": 14 }, "id": 45, "interval": null, @@ -689,6 +1692,12 @@ "datasource": "prometheus", "decimals": 0, "description": "The amount of WAL data that still needs to be archived.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "MBs", "gauge": { "maxValue": 15, @@ -701,7 +1710,7 @@ "h": 6, "w": 4, "x": 4, - "y": 7 + "y": 14 }, "id": 50, "interval": null, @@ -774,6 +1783,12 @@ "datasource": "prometheus", "decimals": 2, "description": "Shows the rate/increase in failed archive actions.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "none", "gauge": { "maxValue": 3, @@ -786,7 +1801,7 @@ "h": 6, "w": 4, "x": 8, - "y": 7 + "y": 14 }, "id": 46, "interval": null, @@ -837,12 +1852,104 @@ "title": "WAL Archive Fails [$rate_interval]", "transparent": true, "type": "singlestat", - "valueFontSize": "70%", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "prometheus", + "decimals": null, + "description": "Active WAL senders in relation to max_wal_senders.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 12, + "y": 14 + }, + "id": 43, + "interval": null, + "links": [], + "mappingType": 2, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "No WS", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "count(sql_pg_stat_replication{job=~'$job', host=~'$host', sql_job=~'$cluster', pid!='0', col='flush_lag_bytes'})/ scalar(sql_settings{job=~'$job', host=~'$host', sql_job=~'$cluster', col='max_wal_senders'})", + "format": "time_series", + "hide": false, + "intervalFactor": 2, + "legendFormat": "", + "refId": "A", + "step": 600 + } + ], + "thresholds": "0.7,0.85", + "title": "WAL Senders", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", "valueMaps": [ { "op": "=", - "text": "N/A", - "value": "null" + "text": "", + "value": "" } ], "valueName": "current" @@ -857,8 +1964,13 @@ "rgba(245, 54, 54, 0.9)" ], "datasource": "prometheus", - "decimals": null, - "description": "Active WAL senders in relation to max_wal_senders.", + "description": "Shows the used prepared transactions in relation to max_prepared_transactions.\n\n'N/A' if not used.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "format": "percentunit", "gauge": { "maxValue": 1, @@ -870,13 +1982,13 @@ "gridPos": { "h": 6, "w": 4, - "x": 12, - "y": 7 + "x": 16, + "y": 14 }, - "id": 43, + "id": 49, "interval": null, "links": [], - "mappingType": 2, + "mappingType": 1, "mappingTypes": [ { "name": "value to text", @@ -897,7 +2009,7 @@ "rangeMaps": [ { "from": "null", - "text": "No WS", + "text": "N/A", "to": "null" } ], @@ -910,25 +2022,24 @@ "tableColumn": "", "targets": [ { - "expr": "count(sql_pg_stat_replication{job=~'$job', host=~'$host', sql_job=~'$cluster', pid!='0', col='flush_lag_bytes'})/ scalar(sql_settings{job=~'$job', host=~'$host', sql_job=~'$cluster', col='max_wal_senders'})", + "expr": "sum(sql_prepared_transactions{job=~'$job', host=~'$host', sql_job=~'$cluster', col='count', datname=~'$datname'}) / sum(sql_settings{job=~'$job', host=~'$host', sql_job=~'$cluster', col='max_prepared_transactions'})", "format": "time_series", - "hide": false, "intervalFactor": 2, "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "0.7,0.85", - "title": "WAL Senders", + "thresholds": "0.8,0.9", + "title": "Prepared Transactions", "transparent": true, "type": "singlestat", - "valueFontSize": "50%", + "valueFontSize": "70%", "valueMaps": [ { "op": "=", - "text": "", - "value": "" + "text": "N/A", + "value": "null" } ], "valueName": "current" @@ -943,10 +2054,17 @@ "rgba(245, 54, 54, 0.9)" ], "datasource": "prometheus", - "description": "Shows the used prepared transactions in relation to max_prepared_transactions.\n\n'N/A' if not used.", - "format": "percentunit", + "decimals": 1, + "description": "Shows the maximum of send_lag_bytes, flush_lag_bytes, replay_lag_bytes over all connected streaming receivers.\nThis is not a sufficient way to monitor if a standby is up to date!\nCan only give a hint if streaming is delayed.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "format": "decbytes", "gauge": { - "maxValue": 1, + "maxValue": 1000000000, "minValue": 0, "show": true, "thresholdLabels": false, @@ -955,10 +2073,10 @@ "gridPos": { "h": 6, "w": 4, - "x": 16, - "y": 7 + "x": 20, + "y": 14 }, - "id": 49, + "id": 64, "interval": null, "links": [], "mappingType": 1, @@ -995,19 +2113,21 @@ "tableColumn": "", "targets": [ { - "expr": "sum(sql_prepared_transactions{job=~'$job', host=~'$host', sql_job=~'$cluster', col='count', datname=~'$datname'}) / sum(sql_settings{job=~'$job', host=~'$host', sql_job=~'$cluster', col='max_prepared_transactions'})", + "expr": "max(sql_pg_stat_replication{job=~'$job', host=~'$host', sql_job=~'$cluster', col=~'(send_lag_bytes|flush_lag_bytes|replay_lag_bytes)'})", "format": "time_series", - "intervalFactor": 2, + "hide": false, + "intervalFactor": 1, "legendFormat": "", + "metric": "node_filesystem_free", "refId": "A", - "step": 600 + "step": 300 } ], - "thresholds": "0.8,0.9", - "title": "Prepared Transactions", + "thresholds": "500000000,750000000", + "title": "Max Replication Lag", "transparent": true, "type": "singlestat", - "valueFontSize": "70%", + "valueFontSize": "50%", "valueMaps": [ { "op": "=", @@ -1015,142 +2135,427 @@ "value": "null" } ], - "valueName": "current" + "valueName": "current" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 70, + "panels": [], + "repeat": null, + "title": "CPU", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "prometheus", + "decimals": 2, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 21 + }, + "hiddenSeries": false, + "id": 1, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (mode) (rate(node_cpu_seconds_total{mode!='idle', job=~'$job'}[$rate_interval]))", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{mode}}", + "metric": "node_cpu", + "refId": "A", + "step": 40 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU Usage (by mode) [$rate_interval]", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Cores", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 21 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (cpu) (irate(node_cpu_seconds_total{mode!='idle', job=~'$job'}[$rate_interval]))", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{cpu}}", + "metric": "node_cpu", + "refId": "A", + "step": 40 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU Usage (by core) [$rate_interval]", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 71, + "panels": [], + "repeat": null, + "title": "Memory", + "type": "row" + }, + { + "aliasColors": { + "Buffers": "#E5AC0E", + "Cached": "#3F6833", + "Free": "#629E51", + "Used": "#BF1B00" + }, + "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "prometheus", - "decimals": 1, - "description": "Shows the maximum of send_lag_bytes, flush_lag_bytes, replay_lag_bytes over all connected streaming receivers.\nThis is not a sufficient way to monitor if a standby is up to date!\nCan only give a hint if streaming is delayed.", - "format": "decbytes", - "gauge": { - "maxValue": 1000000000, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] }, + "fill": 6, + "fillGradient": 0, "gridPos": { - "h": 6, - "w": 4, - "x": 20, - "y": 7 + "h": 7, + "w": 14, + "x": 0, + "y": 29 }, - "id": 64, - "interval": null, + "hiddenSeries": false, + "id": 33, + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "hideEmpty": false, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { - "from": "null", - "text": "N/A", - "to": "null" + "alias": "Free", + "fill": 1 } ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", + "spaceLength": 10, + "stack": true, + "steppedLine": false, "targets": [ { - "expr": "max(sql_pg_stat_replication{job=~'$job', host=~'$host', sql_job=~'$cluster', col=~'(send_lag_bytes|flush_lag_bytes|replay_lag_bytes)'})", + "expr": "node_memory_MemTotal_bytes{job=~'$job'} - (node_memory_MemFree_bytes{job=~'$job'} + node_memory_Buffers_bytes{job=~'$job'} + node_memory_Cached_bytes{job=~'$job'})", "format": "time_series", "hide": false, "intervalFactor": 1, - "legendFormat": "", - "metric": "node_filesystem_free", + "legendFormat": "Used", "refId": "A", - "step": 300 + "step": 30 + }, + { + "expr": "node_memory_Buffers_bytes{job=~'$job'}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Buffers", + "refId": "C", + "step": 30 + }, + { + "expr": "node_memory_Cached_bytes{job=~'$job'}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Cached", + "refId": "D", + "step": 30 + }, + { + "expr": "node_memory_MemFree_bytes{job=~'$job'}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Free", + "refId": "B", + "step": 30 } ], - "thresholds": "500000000,750000000", - "title": "Max Replication Lag", - "transparent": true, - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Memory Distribution", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ { - "op": "=", - "text": "N/A", - "value": "null" + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true } ], - "valueName": "current" + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 13 + "aliasColors": { + "Memory Dirty": "#967302" }, - "id": 70, - "panels": [], - "repeat": null, - "title": "CPU", - "type": "row" - }, - { - "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "decimals": 2, - "fill": 5, + "description": "Modified memory that needs to be written back to permanent storage.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 6, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 12, - "x": 0, - "y": 14 + "w": 6, + "x": 14, + "y": 29 }, - "id": 1, + "hiddenSeries": false, + "id": 23, "legend": { - "alignAsTable": false, "avg": false, "current": false, - "hideEmpty": true, - "hideZero": true, "max": false, "min": false, - "rightSide": false, "show": true, "total": false, "values": false }, "lines": true, - "linewidth": 1, + "linewidth": 2, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -1160,20 +2565,22 @@ "steppedLine": false, "targets": [ { - "expr": "sum by (mode) (rate(node_cpu_seconds_total{mode!='idle', job=~'$job'}[$rate_interval]))", + "expr": "node_memory_Dirty_bytes{job=~'$job'}", "format": "time_series", + "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "{{mode}}", - "metric": "node_cpu", - "refId": "A", - "step": 40 + "legendFormat": "Memory Dirty", + "metric": "node_memory_Dirty", + "refId": "B", + "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "CPU Usage (by mode) [$rate_interval]", + "title": "Memory Dirty", "tooltip": { "shared": true, "sort": 0, @@ -1189,11 +2596,11 @@ }, "yaxes": [ { - "format": "short", - "label": "Cores", + "format": "bytes", + "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -1211,58 +2618,89 @@ } }, { - "aliasColors": {}, + "aliasColors": { + "Cached": "#890F02", + "Free": "#629E51", + "Swap Cached": "#890F02", + "Swap Free": "#7EB26D" + }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "fill": 1, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 12, - "x": 12, - "y": 14 + "w": 4, + "x": 20, + "y": 29 }, - "id": 2, + "hiddenSeries": false, + "id": 19, "legend": { "avg": false, "current": false, - "hideEmpty": true, - "hideZero": true, - "max": false, + "max": true, "min": false, - "show": false, + "show": true, "total": false, - "values": false + "values": true }, "lines": true, - "linewidth": 1, + "linewidth": 2, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [], + "seriesOverrides": [ + { + "alias": "Free", + "fill": 1 + } + ], "spaceLength": 10, "stack": true, "steppedLine": false, "targets": [ { - "expr": "sum by (cpu) (irate(node_cpu_seconds_total{mode!='idle', job=~'$job'}[$rate_interval]))", + "expr": "node_memory_SwapCached_bytes{job=~'$job'}", "format": "time_series", + "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "{{cpu}}", - "metric": "node_cpu", + "legendFormat": "Cached", + "metric": "node_memory_SwapCached", + "refId": "B", + "step": 240 + }, + { + "expr": "node_memory_SwapFree_bytes{job=~'$job'}", + "format": "time_series", + "hide": false, + "intervalFactor": 2, + "legendFormat": "Free", "refId": "A", - "step": 40 + "step": 240 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "CPU Usage (by core) [$rate_interval]", + "title": "Swap Usage", "tooltip": { "shared": true, "sort": 0, @@ -1278,11 +2716,11 @@ }, "yaxes": [ { - "format": "short", + "format": "bytes", "label": null, - "logBase": 1, + "logBase": 2, "max": null, - "min": null, + "min": "1048576", "show": true }, { @@ -1301,108 +2739,109 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 21 + "y": 36 }, - "id": 71, + "id": 72, "panels": [], "repeat": null, - "title": "Memory", + "title": "Filesystem $filesystem", "type": "row" }, { "aliasColors": { - "Buffers": "#E5AC0E", - "Cached": "#3F6833", - "Free": "#629E51", - "Used": "#BF1B00" + "Free \"/\" (/dev/sda1, ext4)": "#629E51", + "Used \"/\" (/dev/sda1, ext4)": "#E5AC0E" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "fill": 6, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 14, + "w": 24, "x": 0, - "y": 22 + "y": 37 }, - "id": 33, + "hiddenSeries": false, + "id": 32, "legend": { - "alignAsTable": false, - "avg": true, + "avg": false, "current": false, - "hideEmpty": false, - "max": true, - "min": true, - "rightSide": false, + "max": false, + "min": false, "show": true, - "sortDesc": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 2, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", + "repeat": "filesystem", + "repeatDirection": "h", "seriesOverrides": [ { - "alias": "Free", + "alias": "/Used.*$/", + "color": "#BF1B00" + }, + { + "alias": "/^Free .*$/", + "color": "#629E51", "fill": 1 - } + }, + {} ], "spaceLength": 10, "stack": true, "steppedLine": false, "targets": [ { - "expr": "node_memory_MemTotal_bytes{job=~'$job'} - (node_memory_MemFree_bytes{job=~'$job'} + node_memory_Buffers_bytes{job=~'$job'} + node_memory_Cached_bytes{job=~'$job'})", - "format": "time_series", - "hide": false, - "intervalFactor": 1, - "legendFormat": "Used", - "refId": "A", - "step": 30 - }, - { - "expr": "node_memory_Buffers_bytes{job=~'$job'}", + "expr": "node_filesystem_size_bytes{mountpoint=~'$filesystem', job=~'$job'} - node_filesystem_avail_bytes{mountpoint=~'$filesystem', device!~'rootfs', job=~'$job'}", "format": "time_series", "hide": false, - "intervalFactor": 1, - "legendFormat": "Buffers", - "refId": "C", - "step": 30 + "intervalFactor": 2, + "legendFormat": "Used \"{{mountpoint}}\" ({{device}}, {{fstype}})", + "metric": "node_filesystem_si", + "refId": "B", + "step": 120 }, { - "expr": "node_memory_Cached_bytes{job=~'$job'}", + "expr": "node_filesystem_avail_bytes{mountpoint=~'$filesystem', device!~'rootfs', job=~'$job'}", "format": "time_series", "hide": false, - "intervalFactor": 1, - "legendFormat": "Cached", - "refId": "D", - "step": 30 - }, - { - "expr": "node_memory_MemFree_bytes{job=~'$job'}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Free", - "refId": "B", - "step": 30 + "intervalFactor": 2, + "legendFormat": "Free \"{{mountpoint}}\" ({{device}}, {{fstype}})", + "metric": "node_filesystem_avail", + "refId": "A", + "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Memory Distribution", + "title": "Filesystem - \"$filesystem\"", "tooltip": { "shared": true, "sort": 0, @@ -1419,18 +2858,18 @@ "yaxes": [ { "format": "bytes", - "label": null, + "label": "", "logBase": 1, "max": null, "min": "0", "show": true }, { - "format": "bytes", + "format": "short", "label": null, "logBase": 1, "max": null, - "min": "0", + "min": null, "show": true } ], @@ -1440,60 +2879,117 @@ } }, { - "aliasColors": { - "Memory Dirty": "#967302" + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 44 }, + "id": 73, + "panels": [], + "repeat": null, + "title": "Disk I/O", + "type": "row" + }, + { + "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "description": "Modified memory that needs to be written back to permanent storage.", - "fill": 6, + "description": "Reads are shown above the \nzero line (>0) and writes are shown below (<0).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, "gridPos": { - "h": 7, - "w": 6, - "x": 14, - "y": 22 + "h": 9, + "w": 8, + "x": 0, + "y": 45 }, - "id": 23, + "height": "", + "hiddenSeries": false, + "id": 4, "legend": { - "avg": false, + "alignAsTable": false, + "avg": true, "current": false, - "max": false, - "min": false, - "show": true, + "hideEmpty": true, + "hideZero": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, "total": false, - "values": false + "values": true }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "node_memory_Dirty_bytes{job=~'$job'}", + "expr": "-1 * irate(node_disk_writes_completed_total{device=~'$disk', job=~'$job'}[$rate_interval])", "format": "time_series", - "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "Memory Dirty", - "metric": "node_memory_Dirty", + "legendFormat": "Writes (completed) {{device}}", + "metric": "node_disk_writes_completed", + "refId": "A", + "step": 120 + }, + { + "expr": "-1 * irate(node_disk_writes_merged_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "Writes (merged) {{device}}", "refId": "B", "step": 120 + }, + { + "expr": "irate(node_disk_reads_completed_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "Reads (completed) {{device}}", + "metric": "node_disk_reads_completed", + "refId": "C", + "step": 120 + }, + { + "expr": "irate(node_disk_reads_merged_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Reads (merged) {{device}}", + "refId": "D", + "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Memory Dirty", + "title": "Read/Write (IOPS) [$rate_interval] - $disk", "tooltip": { "shared": true, "sort": 0, @@ -1509,11 +3005,11 @@ }, "yaxes": [ { - "format": "bytes", - "label": "", + "format": "iops", + "label": "Read/Write (bytes)", "logBase": 1, "max": null, - "min": "0", + "min": null, "show": true }, { @@ -1531,82 +3027,87 @@ } }, { - "aliasColors": { - "Cached": "#890F02", - "Free": "#629E51", - "Swap Cached": "#890F02", - "Swap Free": "#7EB26D" - }, + "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "description": "Reads are shown above the \nzero line (>0) and writes are shown below (<0).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 5, + "fillGradient": 0, "gridPos": { - "h": 7, - "w": 4, - "x": 20, - "y": 22 + "h": 9, + "w": 8, + "x": 8, + "y": 45 }, - "id": 19, + "height": "", + "hiddenSeries": false, + "id": 3, "legend": { - "avg": false, + "avg": true, "current": false, + "hideEmpty": true, + "hideZero": true, "max": true, - "min": false, - "show": true, + "min": true, + "show": false, "total": false, "values": true }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Free", - "fill": 1 - } - ], + "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "node_memory_SwapCached_bytes{job=~'$job'}", + "expr": "-1 * irate(node_disk_written_bytes_total{device=~'$disk', job=~'$job'}[$rate_interval])", "format": "time_series", - "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "Cached", - "metric": "node_memory_SwapCached", - "refId": "B", - "step": 240 + "legendFormat": "Write {{device}}", + "metric": "node_disk_bytes_read", + "refId": "A", + "step": 120 }, { - "expr": "node_memory_SwapFree_bytes{job=~'$job'}", + "expr": "irate(node_disk_read_bytes_total{device=~'$disk', job=~'$job'}[$rate_interval])", "format": "time_series", - "hide": false, + "interval": "", "intervalFactor": 2, - "legendFormat": "Free", - "refId": "A", - "step": 240 + "legendFormat": "Read {{device}}", + "refId": "B", + "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Swap Usage", + "title": "Read/Write (bytes) [$rate_interval] - $disk", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, - "transparent": false, "type": "graph", "xaxis": { "buckets": null, @@ -1617,11 +3118,11 @@ }, "yaxes": [ { - "format": "bytes", - "label": null, - "logBase": 2, + "format": "Bps", + "label": "Read/Write (bytes)", + "logBase": 1, "max": null, - "min": "1048576", + "min": null, "show": true }, { @@ -1639,103 +3140,89 @@ } }, { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 29 - }, - "id": 72, - "panels": [], - "repeat": null, - "title": "Filesystem $filesystem", - "type": "row" - }, - { - "aliasColors": { - "Free \"/\" (/dev/sda1, ext4)": "#629E51", - "Used \"/\" (/dev/sda1, ext4)": "#E5AC0E" - }, + "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "description": "Reads are shown above the \nzero line (>0) and writes are shown below (<0).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 5, + "fillGradient": 0, "gridPos": { - "h": 7, + "h": 9, "w": 8, - "x": 0, - "y": 30 + "x": 16, + "y": 45 }, - "id": 32, + "height": "", + "hiddenSeries": false, + "id": 7, "legend": { - "avg": false, + "avg": true, "current": false, - "max": false, + "hideEmpty": true, + "hideZero": true, + "max": true, "min": false, - "show": true, + "show": false, "total": false, - "values": false + "values": true }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], - "minSpan": null, "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "repeat": "filesystem", - "repeatDirection": "h", - "seriesOverrides": [ - { - "alias": "/Used.*$/", - "color": "#BF1B00" - }, - { - "alias": "/^Free .*$/", - "color": "#629E51", - "fill": 1 - }, - {} - ], + "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "node_filesystem_size_bytes{mountpoint=~'$filesystem', job=~'$job'} - node_filesystem_avail_bytes{mountpoint=~'$filesystem', device!~'rootfs', job=~'$job'}", + "expr": "-1 * irate(node_disk_write_time_seconds_total{device=~'$disk', job=~'$job'}[$rate_interval])", "format": "time_series", "hide": false, + "interval": "", "intervalFactor": 2, - "legendFormat": "Used \"{{mountpoint}}\" ({{device}}, {{fstype}})", - "metric": "node_filesystem_si", - "refId": "B", + "legendFormat": "Writes {{device}}", + "metric": "node_disk", + "refId": "A", "step": 120 }, { - "expr": "node_filesystem_avail_bytes{mountpoint=~'$filesystem', device!~'rootfs', job=~'$job'}", + "expr": "irate(node_disk_read_time_seconds_total{device=~'$disk', job=~'$job'}[$rate_interval])", "format": "time_series", "hide": false, + "interval": "", "intervalFactor": 2, - "legendFormat": "Free \"{{mountpoint}}\" ({{device}}, {{fstype}})", - "metric": "node_filesystem_avail", - "refId": "A", + "legendFormat": "Read {{device}}", + "refId": "B", "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Filesystem - \"$filesystem\"", + "title": "Read/Write Time [$rate_interval] - $disk", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, - "transparent": false, "type": "graph", "xaxis": { "buckets": null, @@ -1746,11 +3233,11 @@ }, "yaxes": [ { - "format": "bytes", - "label": "", + "format": "s", + "label": "Read/Write Time", "logBase": 1, "max": null, - "min": "0", + "min": null, "show": true }, { @@ -1769,16 +3256,17 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 54 }, - "id": 73, + "id": 74, "panels": [], "repeat": null, - "title": "Disk I/O", + "title": "Network", "type": "row" }, { @@ -1787,34 +3275,41 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", - "description": "Reads are shown above the \nzero line (>0) and writes are shown below (<0).", - "fill": 5, + "description": "RX is shown above the \nzero line (>0) and TX is shown below (<0).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 3, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, + "h": 7, + "w": 12, "x": 0, - "y": 38 + "y": 55 }, - "height": "", - "id": 4, + "hiddenSeries": false, + "id": 20, "legend": { - "alignAsTable": false, - "avg": true, + "avg": false, "current": false, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": false, + "max": false, + "min": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -1824,47 +3319,31 @@ "steppedLine": false, "targets": [ { - "expr": "-1 * irate(node_disk_writes_completed_total{device=~'$disk', job=~'$job'}[$rate_interval])", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "Writes (completed) {{device}}", - "metric": "node_disk_writes_completed", - "refId": "A", - "step": 120 - }, - { - "expr": "-1 * irate(node_disk_writes_merged_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "expr": "irate(node_network_receive_bytes_total{device=~'$interface', job=~'$job'}[$rate_interval])", "format": "time_series", + "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "Writes (merged) {{device}}", + "legendFormat": "Received {{device}}", + "metric": "node_network_receive_bytes", "refId": "B", - "step": 120 + "step": 60 }, { - "expr": "irate(node_disk_reads_completed_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "expr": "-1 * irate(node_network_transmit_bytes_total{device=~'$interface', job=~'$job'}[$rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "Reads (completed) {{device}}", - "metric": "node_disk_reads_completed", - "refId": "C", - "step": 120 - }, - { - "expr": "irate(node_disk_reads_merged_total{device=~'$disk', job=~'$job'}[$rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Reads (merged) {{device}}", - "refId": "D", - "step": 120 + "legendFormat": "Send {{device}}", + "refId": "A", + "step": 60 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Read/Write (IOPS) [$rate_interval] - $disk", + "title": "Network Traffic [$rate_interval] - $interface", "tooltip": { "shared": true, "sort": 0, @@ -1880,8 +3359,8 @@ }, "yaxes": [ { - "format": "iops", - "label": "Read/Write (bytes)", + "format": "Bps", + "label": null, "logBase": 1, "max": null, "min": null, @@ -1907,32 +3386,41 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", - "description": "Reads are shown above the \nzero line (>0) and writes are shown below (<0).", - "fill": 5, + "description": "RX is shown above the \nzero line (>0) and TX is shown below (<0).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 3, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, - "x": 8, - "y": 38 + "h": 7, + "w": 12, + "x": 12, + "y": 55 }, - "height": "", - "id": 3, + "hiddenSeries": false, + "id": 21, "legend": { - "avg": true, + "avg": false, "current": false, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": false, + "max": false, + "min": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -1942,29 +3430,31 @@ "steppedLine": false, "targets": [ { - "expr": "-1 * irate(node_disk_written_bytes_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "expr": "irate(node_network_receive_packets_total{device=~'$interface', job=~'$job'}[$rate_interval])", "format": "time_series", + "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "Write {{device}}", - "metric": "node_disk_bytes_read", - "refId": "A", + "legendFormat": "Received {{device}}", + "metric": "node_network_receive_packets", + "refId": "B", "step": 120 }, { - "expr": "irate(node_disk_read_bytes_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "expr": "-1 * irate(node_network_transmit_packets_total{device=~'$interface', job=~'$job'}[$rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "Read {{device}}", - "refId": "B", + "legendFormat": "Send {{device}}", + "refId": "A", "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Read/Write (bytes) [$rate_interval] - $disk", + "title": "Network Packets [$rate_interval] - $interface", "tooltip": { "shared": true, "sort": 0, @@ -1980,8 +3470,8 @@ }, "yaxes": [ { - "format": "Bps", - "label": "Read/Write (bytes)", + "format": "iops", + "label": null, "logBase": 1, "max": null, "min": null, @@ -2001,38 +3491,63 @@ "alignLevel": null } }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 62 + }, + "id": 76, + "panels": [], + "repeat": null, + "title": "PostgreSQL Database Size", + "type": "row" + }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "description": "Reads are shown above the \nzero line (>0) and writes are shown below (<0).", - "fill": 5, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 9, - "w": 8, - "x": 16, - "y": 38 + "h": 7, + "w": 12, + "x": 0, + "y": 63 }, - "height": "", - "id": 7, + "hiddenSeries": false, + "id": 67, "legend": { - "avg": true, + "avg": false, "current": false, - "hideEmpty": true, - "hideZero": true, - "max": true, + "hideEmpty": false, + "hideZero": false, + "max": false, "min": false, - "show": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -2042,31 +3557,20 @@ "steppedLine": false, "targets": [ { - "expr": "-1 * irate(node_disk_write_time_seconds_total{device=~'$disk', job=~'$job'}[$rate_interval])", + "expr": "rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', datname=~'$datname', col='dbsize'}[$rate_interval])", "format": "time_series", - "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "Writes {{device}}", - "metric": "node_disk", + "legendFormat": "{{datname}}", "refId": "A", - "step": 120 - }, - { - "expr": "irate(node_disk_read_time_seconds_total{device=~'$disk', job=~'$job'}[$rate_interval])", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 2, - "legendFormat": "Read {{device}}", - "refId": "B", - "step": 120 + "step": 40 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Read/Write Time [$rate_interval] - $disk", + "title": "Database Growth [$rate_interval] - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2082,11 +3586,11 @@ }, "yaxes": [ { - "format": "s", - "label": "Read/Write Time", + "format": "Bps", + "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -2103,49 +3607,48 @@ "alignLevel": null } }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 47 - }, - "id": 74, - "panels": [], - "repeat": null, - "title": "Network", - "type": "row" - }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "description": "RX is shown above the \nzero line (>0) and TX is shown below (<0).", - "fill": 3, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 12, - "x": 0, - "y": 48 + "x": 12, + "y": 63 }, - "id": 20, + "hiddenSeries": false, + "id": 68, "legend": { - "avg": false, + "avg": true, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, "show": true, "total": false, - "values": false + "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -2155,30 +3658,20 @@ "steppedLine": false, "targets": [ { - "expr": "irate(node_network_receive_bytes_total{device=~'$interface', job=~'$job'}[$rate_interval])", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 2, - "legendFormat": "Received {{device}}", - "metric": "node_network_receive_bytes", - "refId": "B", - "step": 60 - }, - { - "expr": "-1 * irate(node_network_transmit_bytes_total{device=~'$interface', job=~'$job'}[$rate_interval])", + "expr": "sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', datname=~'$datname', col='dbsize'}", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "Send {{device}}", + "legendFormat": "{{datname}}", "refId": "A", - "step": 60 + "step": 40 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Network Traffic [$rate_interval] - $interface", + "title": "Database Size - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2194,11 +3687,11 @@ }, "yaxes": [ { - "format": "Bps", - "label": null, + "format": "bytes", + "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -2215,73 +3708,124 @@ "alignLevel": null } }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 70 + }, + "id": 75, + "panels": [], + "repeat": null, + "title": "PostgreSQL Connections", + "type": "row" + }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "description": "RX is shown above the \nzero line (>0) and TX is shown below (<0).", - "fill": 3, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 7, + "h": 9, "w": 12, - "x": 12, - "y": 48 + "x": 0, + "y": 71 }, - "id": 21, + "hiddenSeries": false, + "id": 6, "legend": { - "avg": false, - "current": false, - "max": false, + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": true, "min": false, + "rightSide": false, "show": true, + "sort": "avg", + "sortDesc": false, "total": false, - "values": false + "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [], + "seriesOverrides": [ + { + "$$hashKey": "object:5500", + "alias": "waiting", + "color": "#F2495C" + }, + { + "$$hashKey": "object:5508", + "alias": "idle in transaction", + "color": "#FF9830" + }, + { + "$$hashKey": "object:5516", + "alias": "active", + "color": "#73BF69" + }, + { + "$$hashKey": "object:5530", + "alias": "idle", + "color": "#5794F2" + }, + { + "$$hashKey": "object:743", + "alias": "idle in transaction (aborted)", + "color": "#FADE2A" + } + ], "spaceLength": 10, - "stack": false, + "stack": true, "steppedLine": false, "targets": [ { - "expr": "irate(node_network_receive_packets_total{device=~'$interface', job=~'$job'}[$rate_interval])", + "expr": "sort_desc(sum by (state) (sql_pg_stat_activity{job=~'$job', host=~'$host', sql_job=~'$cluster', col='count', datname=~'$datname'}))", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 2, - "legendFormat": "Received {{device}}", - "metric": "node_network_receive_packets", - "refId": "B", - "step": 120 - }, - { - "expr": "-1 * irate(node_network_transmit_packets_total{device=~'$interface', job=~'$job'}[$rate_interval])", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "Send {{device}}", + "legendFormat": "{{state}}", + "metric": "sql_pg_stat_activity", "refId": "A", - "step": 120 + "step": 60 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Network Packets [$rate_interval] - $interface", + "title": "Connections by State - $datname", "tooltip": { "shared": true, - "sort": 0, + "sort": 2, "value_type": "individual" }, + "transformations": [], "type": "graph", "xaxis": { "buckets": null, @@ -2292,16 +3836,20 @@ }, "yaxes": [ { - "format": "iops", - "label": null, + "$$hashKey": "object:5021", + "decimals": 0, + "format": "short", + "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { + "$$hashKey": "object:5022", + "decimals": 3, "format": "short", - "label": null, + "label": "", "logBase": 1, "max": null, "min": null, @@ -2313,39 +3861,31 @@ "alignLevel": null } }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 55 - }, - "id": 76, - "panels": [], - "repeat": null, - "title": "PostgreSQL Database Size", - "type": "row" - }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 7, + "h": 9, "w": 12, - "x": 0, - "y": 56 + "x": 12, + "y": 71 }, - "id": 67, + "hiddenSeries": false, + "id": 9, "legend": { "avg": false, "current": false, - "hideEmpty": false, - "hideZero": false, "max": false, "min": false, "show": true, @@ -2356,29 +3896,39 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [], + "seriesOverrides": [ + { + "$$hashKey": "object:1166" + } + ], "spaceLength": 10, - "stack": false, + "stack": true, "steppedLine": false, "targets": [ { - "expr": "rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', datname=~'$datname', col='dbsize'}[$rate_interval])", + "expr": "sum by (datname) (sql_pg_stat_activity{job=~'$job', host=~'$host', sql_job=~'$cluster', col='count', datname=~'$datname'})", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{datname}}", + "metric": "sql_pg_stat_activity", "refId": "A", - "step": 40 + "step": 60 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Database Growth [$rate_interval] - $datname", + "title": "Connections by Database - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2394,14 +3944,17 @@ }, "yaxes": [ { - "format": "Bps", + "$$hashKey": "object:715", + "decimals": 0, + "format": "short", "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { + "$$hashKey": "object:716", "format": "short", "label": null, "logBase": 1, @@ -2415,36 +3968,60 @@ "alignLevel": null } }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 80 + }, + "id": 93, + "panels": [], + "title": "PostgreSQL Transactions and Locks", + "type": "row" + }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 12, - "x": 12, - "y": 56 + "w": 7, + "x": 0, + "y": 81 }, - "id": 68, + "hiddenSeries": false, + "id": 10, "legend": { - "avg": true, + "avg": false, "current": false, - "hideEmpty": false, - "hideZero": false, "max": false, "min": false, "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -2454,19 +4031,36 @@ "steppedLine": false, "targets": [ { - "expr": "sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', datname=~'$datname', col='dbsize'}", + "expr": "sum by (datname) (rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', col='xact_commit', datname=~'$datname'}[$rate_interval]))", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "{{datname}}", + "legendFormat": "commits {{datname}}", + "metric": "sql_pg_stat_database", "refId": "A", - "step": 40 + "step": 60 + }, + { + "expr": "sum by (datname) (rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', col='xact_rollback', datname=~'$datname'}[$rate_interval]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "rollbacks {{datname}}", + "refId": "B", + "step": 60 + }, + { + "expr": "rate(sql_txid{job=~'$job', host=~'$host', sql_job=~'$cluster'}[$rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "TXIDs (global)", + "refId": "C" } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Database Size - $datname", + "title": "Transactions by database [$rate_interval] - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2482,14 +4076,16 @@ }, "yaxes": [ { - "format": "bytes", - "label": "", + "$$hashKey": "object:1487", + "format": "ops", + "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { + "$$hashKey": "object:1488", "format": "short", "label": null, "logBase": 1, @@ -2503,72 +4099,68 @@ "alignLevel": null } }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 63 - }, - "id": 75, - "panels": [], - "repeat": null, - "title": "PostgreSQL Connections", - "type": "row" - }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "fill": 5, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 12, - "x": 0, - "y": 64 + "w": 5, + "x": 7, + "y": 81 }, - "id": 8, + "hiddenSeries": false, + "id": 91, "legend": { "avg": false, "current": false, - "max": false, + "max": true, "min": false, "show": true, "total": false, - "values": false + "values": true }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum by (state) (sql_pg_stat_activity{job=~'$job', host=~'$host', sql_job=~'$cluster', col='count', datname=~'$datname'})", + "expr": "max by (datname) (sql_pg_stat_activity{job=~'$job', host=~'$host', sql_job=~'$cluster', col='max_tx_duration', datname=~'$datname'})", "format": "time_series", - "hide": false, "interval": "", - "intervalFactor": 2, - "legendFormat": "{{state}}", - "metric": "sql_pg_stat_activity", - "refId": "A", - "step": 60 + "intervalFactor": 1, + "legendFormat": "{{datname}}", + "refId": "A" } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Connections by State - $datname", + "title": "Maximum Transaction Age", "tooltip": { "shared": true, "sort": 0, @@ -2584,14 +4176,16 @@ }, "yaxes": [ { - "format": "short", - "label": "", + "$$hashKey": "object:1565", + "format": "s", + "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { + "$$hashKey": "object:1566", "format": "short", "label": null, "logBase": 1, @@ -2606,19 +4200,30 @@ } }, { - "aliasColors": {}, + "aliasColors": { + "AccessExclusiveLock": "#99440A", + "ExclusiveLock": "#BF1B00" + }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "fill": 5, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 12, + "w": 6, "x": 12, - "y": 64 + "y": 81 }, - "id": 9, + "hiddenSeries": false, + "id": 42, "legend": { "avg": false, "current": false, @@ -2632,30 +4237,46 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [], + "seriesOverrides": [ + { + "$$hashKey": "object:1299", + "alias": "ExclusiveLock", + "color": "#BF1B00", + "fill": 6, + "linewidth": 4 + }, + { + "$$hashKey": "object:1300", + "alias": "AccessExclusiveLock", + "color": "#58140C" + } + ], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum by (datname) (sql_pg_stat_activity{job=~'$job', host=~'$host', sql_job=~'$cluster', col='count', datname=~'$datname'})", + "expr": "sum (sql_pg_locks{job=~'$job', host=~'$host', sql_job=~'$cluster', datname=~'$datname'}) by (mode)", "format": "time_series", - "interval": "", "intervalFactor": 2, - "legendFormat": "{{datname}}", - "metric": "sql_pg_stat_activity", + "legendFormat": "{{ mode }}", "refId": "A", - "step": 60 + "step": 20 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Connections by Database - $datname", + "title": "Locks - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2671,14 +4292,17 @@ }, "yaxes": [ { + "$$hashKey": "object:1317", + "decimals": 0, "format": "short", - "label": "", + "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { + "$$hashKey": "object:1318", "format": "short", "label": null, "logBase": 1, @@ -2692,33 +4316,29 @@ "alignLevel": null } }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 71 - }, - "id": 93, - "panels": [], - "title": "PostgreSQL Transactions and Locks", - "type": "row" - }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 9, - "x": 0, - "y": 72 + "w": 6, + "x": 18, + "y": 81 }, - "id": 10, + "hiddenSeries": false, + "id": 121, "legend": { "avg": false, "current": false, @@ -2732,45 +4352,39 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [], + "seriesOverrides": [ + { + "$$hashKey": "object:1071", + "alias": "/.*/", + "color": "#FADE2A" + } + ], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum by (datname) (rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', col='xact_commit', datname=~'$datname'}[$rate_interval]))", + "expr": "rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', col='deadlocks', datname=~'$datname'}[90s]) * 60", "format": "time_series", "interval": "", - "intervalFactor": 2, - "legendFormat": "commits {{datname}}", - "metric": "sql_pg_stat_database", - "refId": "A", - "step": 60 - }, - { - "expr": "sum by (datname) (rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster', col='xact_rollback', datname=~'$datname'}[$rate_interval]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "rollbacks {{datname}}", - "refId": "B", - "step": 60 - }, - { - "expr": "rate(sql_txid{job=~'$job', host=~'$host', sql_job=~'$cluster'}[$rate_interval])", - "format": "time_series", "intervalFactor": 1, - "legendFormat": "TXIDs (global)", - "refId": "C" + "legendFormat": "deadlocks {{datname}}", + "refId": "A" } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Transactions by database [$rate_interval] - $datname", + "title": "Deadlocks -$datname", "tooltip": { "shared": true, "sort": 0, @@ -2786,7 +4400,9 @@ }, "yaxes": [ { - "format": "ops", + "$$hashKey": "object:1085", + "decimals": 0, + "format": "none", "label": null, "logBase": 1, "max": null, @@ -2794,6 +4410,7 @@ "show": true }, { + "$$hashKey": "object:1086", "format": "short", "label": null, "logBase": 1, @@ -2807,35 +4424,65 @@ "alignLevel": null } }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 88 + }, + "id": 78, + "panels": [], + "repeat": null, + "title": "PostgreSQL Tuple Activity", + "type": "row" + }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 8, - "x": 9, - "y": 72 + "w": 14, + "x": 0, + "y": 89 }, - "id": 91, + "hiddenSeries": false, + "id": 24, "legend": { + "alignAsTable": false, "avg": false, "current": false, - "max": true, + "hideZero": false, + "max": false, "min": false, + "rightSide": false, "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, - "pointradius": 5, + "pluginVersion": "7.4.3", + "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], @@ -2844,17 +4491,32 @@ "steppedLine": false, "targets": [ { - "expr": "max by (datname) (sql_pg_stat_activity{job=~'$job', host=~'$host', sql_job=~'$cluster', col='max_tx_duration'})", + "expr": "rate(sql_pg_stat_database{job='$job', host=~'$host', sql_job=~'$cluster.*', datname=~'$datname', col='tup_returned'}[$rate_interval])", "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{datname}}", - "refId": "A" + "hide": false, + "instant": "", + "interval": "", + "intervalFactor": 2, + "legendFormat": "Select (table scan) {{datname}}", + "refId": "A", + "step": 120 + }, + { + "expr": "rate(sql_pg_stat_database{job='$job', host=~'$host', sql_job=~'$cluster.*', datname=~'$datname', col='tup_fetched'}[$rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "Select (index scan) {{datname}}", + "refId": "B", + "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Maximum Transaction Age", + "title": "Read Stats [$rate_interval] - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2870,20 +4532,22 @@ }, "yaxes": [ { - "format": "s", - "label": null, + "$$hashKey": "object:3090", + "format": "short", + "label": "Rows", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { + "$$hashKey": "object:3091", "format": "short", "label": null, "logBase": 1, "max": null, "min": null, - "show": true + "show": false } ], "yaxis": { @@ -2892,25 +4556,32 @@ } }, { - "aliasColors": { - "AccessExclusiveLock": "#99440A", - "ExclusiveLock": "#BF1B00" - }, + "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", - "fill": 3, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 7, - "x": 17, - "y": 72 + "w": 10, + "x": 14, + "y": 89 }, - "id": 42, + "hiddenSeries": false, + "id": 16, "legend": { "avg": false, "current": false, + "hideEmpty": true, + "hideZero": true, "max": false, "min": false, "show": true, @@ -2918,42 +4589,38 @@ "values": false }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [ - { - "alias": "ExclusiveLock", - "color": "#BF1B00", - "fill": 6, - "linewidth": 4 - }, - { - "alias": "AccessExclusiveLock", - "color": "#58140C" - } - ], + "seriesOverrides": [], "spaceLength": 10, - "stack": false, + "stack": true, "steppedLine": false, "targets": [ { - "expr": "sum (sql_pg_locks{job=~'$job', host=~'$host', sql_job=~'$cluster', datname=~'$datname'}) by (mode)", + "expr": "topk($ntop_relations, sql_pg_stat_user_tables{job='$job', host=~'$host', sql_job=~'$cluster.*', col='n_live_tup', datname=~'$datname'})", "format": "time_series", + "interval": "", "intervalFactor": 2, - "legendFormat": "{{ mode }}", + "legendFormat": "live {{schemaname}}.{{relname}} ({{database}})", + "metric": "sql_pg_stat_user_tables", "refId": "A", - "step": 20 + "step": 40 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Locks - $datname", + "title": "Live Tuples (top $ntop_relations) - $datname", "tooltip": { "shared": true, "sort": 0, @@ -2970,10 +4637,10 @@ "yaxes": [ { "format": "short", - "label": null, + "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -2990,39 +4657,33 @@ "alignLevel": null } }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 79 - }, - "id": 78, - "panels": [], - "repeat": null, - "title": "PostgreSQL Tuple Activity", - "type": "row" - }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 10, + "w": 14, "x": 0, - "y": 80 + "y": 96 }, - "id": 24, + "hiddenSeries": false, + "id": 122, "legend": { "alignAsTable": false, "avg": false, "current": false, - "hideZero": true, + "hideZero": false, "max": false, "min": false, "rightSide": false, @@ -3034,7 +4695,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 2, "points": false, "renderer": "flot", @@ -3049,7 +4714,7 @@ "hide": false, "intervalFactor": 2, "legendFormat": "Insert {{datname}}", - "refId": "B", + "refId": "A", "step": 120 }, { @@ -3058,7 +4723,7 @@ "hide": false, "intervalFactor": 2, "legendFormat": "Update {{datname}}", - "refId": "C", + "refId": "B", "step": 120 }, { @@ -3067,14 +4732,15 @@ "hide": false, "intervalFactor": 2, "legendFormat": "Delete {{datname}}", - "refId": "D", + "refId": "C", "step": 120 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Inserts Updates Deletes [$rate_interval]", + "title": "Change Stats [$rate_interval] - $datname", "tooltip": { "shared": true, "sort": 0, @@ -3090,14 +4756,16 @@ }, "yaxes": [ { - "format": "ops", - "label": "", + "$$hashKey": "object:3016", + "format": "short", + "label": "Rows", "logBase": 1, "max": null, "min": "0", "show": true }, { + "$$hashKey": "object:3017", "format": "short", "label": null, "logBase": 1, @@ -3117,14 +4785,22 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 5, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 7, - "x": 10, - "y": 80 + "w": 5, + "x": 14, + "y": 96 }, - "id": 16, + "hiddenSeries": false, + "id": 12, "legend": { "avg": false, "current": false, @@ -3140,7 +4816,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3150,20 +4830,21 @@ "steppedLine": false, "targets": [ { - "expr": "topk($ntop_relations, sql_pg_stat_user_tables{job='$job', host=~'$host', sql_job=~'$cluster.*', col='n_live_tup', datname=~'$datname'})", + "expr": "topk($ntop_relations, sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='n_dead_tup', database=~'$datname'})", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "live {{schemaname}}.{{relname}} ({{database}})", - "metric": "sql_pg_stat_user_tables", - "refId": "A", + "legendFormat": "dead {{schemaname}}.{{relname}} ({{database}})", + "metric": "", + "refId": "B", "step": 40 } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Live Tuples (top $ntop_relations) - $datname", + "title": "Dead Tuples (top $ntop_relations) - $datname", "tooltip": { "shared": true, "sort": 0, @@ -3180,7 +4861,7 @@ "yaxes": [ { "format": "short", - "label": "", + "label": null, "logBase": 1, "max": null, "min": "0", @@ -3206,14 +4887,22 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", - "fill": 5, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, - "w": 7, - "x": 17, - "y": 80 + "w": 5, + "x": 19, + "y": 96 }, - "id": 12, + "hiddenSeries": false, + "id": 123, "legend": { "avg": false, "current": false, @@ -3229,21 +4918,25 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "topk($ntop_relations, sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='n_dead_tup', database=~'$datname'})", + "expr": "rate(sql_pg_stat_database{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='temp_bytes', database=~'$datname'}[$rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "dead {{schemaname}}.{{relname}} ({{database}})", + "legendFormat": "temp bytes {{database}}", "metric": "", "refId": "B", "step": 40 @@ -3251,8 +4944,9 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Dead Tuples (top $ntop_relations) - $datname", + "title": "Temp Files [$rate_interval] - $datname", "tooltip": { "shared": true, "sort": 0, @@ -3268,7 +4962,8 @@ }, "yaxes": [ { - "format": "short", + "$$hashKey": "object:3200", + "format": "binBps", "label": null, "logBase": 1, "max": null, @@ -3276,6 +4971,7 @@ "show": true }, { + "$$hashKey": "object:3201", "format": "short", "label": null, "logBase": 1, @@ -3291,11 +4987,12 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 87 + "y": 103 }, "id": 77, "panels": [], @@ -3309,13 +5006,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 5, + "fillGradient": 0, "gridPos": { "h": 8, "w": 9, "x": 0, - "y": 88 + "y": 104 }, + "hiddenSeries": false, "id": 5, "legend": { "avg": false, @@ -3332,7 +5037,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3342,7 +5051,7 @@ "steppedLine": false, "targets": [ { - "expr": "topk($ntop_relations, rate(sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='seq_scan', database=~'$datname'}[$rate_interval]))", + "expr": "topk($ntop_relations, rate(sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='seq_tup_read', database=~'$datname'}[$rate_interval]))", "format": "time_series", "interval": "", "intervalFactor": 2, @@ -3354,8 +5063,9 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Sequential Scans [$rate_interval] (top $ntop_relations) - $datname", + "title": "Sequential Scan Tuples [$rate_interval] (top $ntop_relations) - $datname", "tooltip": { "shared": true, "sort": 0, @@ -3371,7 +5081,7 @@ }, "yaxes": [ { - "format": "ops", + "format": "short", "label": null, "logBase": 1, "max": null, @@ -3398,13 +5108,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 5, + "fillGradient": 0, "gridPos": { "h": 8, "w": 9, "x": 9, - "y": 88 + "y": 104 }, + "hiddenSeries": false, "id": 55, "legend": { "avg": false, @@ -3421,7 +5139,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3431,11 +5153,11 @@ "steppedLine": false, "targets": [ { - "expr": "topk($ntop_relations, rate(sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='idx_scan', datname=~'$datname'}[$rate_interval]))", + "expr": "topk($ntop_relations, sort_desc((sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='seq_tup_read', datname=~'$datname'} > 0 ) / ignoring(col) (sql_pg_stat_user_tables{job=~'$job', host=~'$host', sql_job=~'$cluster.*', col='idx_tup_fetch', datname=~'$datname'} > 0 )))", "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "idx scans {{schemaname}}.{{relname}} ({{database}})", + "legendFormat": "seq/idx scan tuple ratio {{schemaname}}.{{relname}} ({{database}})", "metric": "sql_pg_stat_user_tables", "refId": "A", "step": 40 @@ -3443,8 +5165,9 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Index Scans [$rate_interval] (top $ntop_relations) - $datname", + "title": "Seq/Index Tuple Ratio [$rate_interval] (top $ntop_relations) - $datname", "tooltip": { "shared": true, "sort": 0, @@ -3460,7 +5183,7 @@ }, "yaxes": [ { - "format": "ops", + "format": "none", "label": null, "logBase": 1, "max": null, @@ -3487,13 +5210,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 8, "w": 6, "x": 18, - "y": 88 + "y": 104 }, + "hiddenSeries": false, "id": 27, "legend": { "avg": false, @@ -3508,7 +5239,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3536,6 +5271,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Buffer Hits and Misses [$rate_interval] - $datname", "tooltip": { @@ -3576,11 +5312,12 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 96 + "y": 112 }, "id": 80, "panels": [], @@ -3594,13 +5331,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 7, "x": 0, - "y": 97 + "y": 113 }, + "hiddenSeries": false, "id": 26, "legend": { "alignAsTable": false, @@ -3619,7 +5364,11 @@ "linewidth": 2, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3633,16 +5382,25 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "WAL new", + "legendFormat": "WAL traffic", "metric": "sql_waldistance", "refId": "A", "step": 60 + }, + { + "expr": "rate(sql_checkpoints{col=\"buffers\", job=~'$job', host=~'$host', sql_job=~'$cluster'}[$rate_interval]) * 8192", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "Checkpoint traffic", + "refId": "B" } ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "WAL Traffic [$rate_interval]", + "title": "WAL/Checkpoint Traffic [$rate_interval]", "tooltip": { "shared": true, "sort": 0, @@ -3662,7 +5420,7 @@ "label": "", "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -3685,13 +5443,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 9, "x": 7, - "y": 97 + "y": 113 }, + "hiddenSeries": false, "id": 29, "legend": { "avg": false, @@ -3706,17 +5472,32 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", - "seriesOverrides": [], + "seriesOverrides": [ + { + "$$hashKey": "object:795", + "alias": "requested (explicit, wal or backup-based)", + "color": "#FADE2A" + }, + { + "$$hashKey": "object:803", + "alias": "timed", + "color": "#73BF69" + } + ], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { - "expr": "60 * rate(sql_checkpoints{job=~'$job', host=~'$host', sql_job=~'$cluster'}[$rate_interval])", + "expr": "60 * rate(sql_checkpoints{job=~'$job', host=~'$host', sql_job=~'$cluster'}[90s])", "format": "time_series", "interval": "", "intervalFactor": 2, @@ -3728,13 +5509,35 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "Checkpoints per Minute [$rate_interval]", + "title": "Checkpoints per Minute", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "requested", + "renamePattern": "requested (explicit, wal or backup-based)" + } + }, + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "Time", + "requested (explicit, wal or backup-based)", + "timed" + ] + } + } + } + ], "type": "graph", "xaxis": { "buckets": null, @@ -3745,11 +5548,13 @@ }, "yaxes": [ { + "$$hashKey": "object:673", + "decimals": 0, "format": "opm", "label": null, "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -3774,13 +5579,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 97 + "y": 113 }, + "hiddenSeries": false, "id": 31, "legend": { "avg": false, @@ -3795,7 +5608,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3817,6 +5634,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "WAL since last Checkpoint", "tooltip": { @@ -3824,7 +5642,6 @@ "sort": 0, "value_type": "individual" }, - "transparent": false, "type": "graph", "xaxis": { "buckets": null, @@ -3839,7 +5656,7 @@ "label": null, "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -3858,11 +5675,12 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 104 + "y": 120 }, "id": 81, "panels": [], @@ -3876,13 +5694,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 10, "x": 0, - "y": 105 + "y": 121 }, + "hiddenSeries": false, "id": 30, "legend": { "alignAsTable": false, @@ -3901,7 +5727,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -3923,6 +5753,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Maintenance Operations per Minute [$rate_interval] - $datname", "tooltip": { @@ -3967,13 +5798,21 @@ "dashLength": 10, "dashes": false, "datasource": "prometheus", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 9, "x": 10, - "y": 105 + "y": 121 }, + "hiddenSeries": false, "id": 53, "legend": { "avg": false, @@ -3990,7 +5829,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4012,6 +5855,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Maintenance Counters - $datname", "tooltip": { @@ -4057,13 +5901,21 @@ "dashes": false, "datasource": "prometheus", "description": "Age of oldest XID in database\n\nWhen reaching autovacuum_max_freeze_age (default: 200 M), tables will be frozen by autovacuum.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 5, "x": 19, - "y": 105 + "y": 121 }, + "hiddenSeries": false, "id": 54, "legend": { "alignAsTable": false, @@ -4080,7 +5932,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4102,6 +5958,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Database Freeze Age - $datname", "tooltip": { @@ -4123,7 +5980,7 @@ "label": null, "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -4142,11 +5999,12 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 112 + "y": 128 }, "id": 85, "panels": [], @@ -4161,13 +6019,21 @@ "dashes": false, "datasource": "prometheus", "description": "Number of WAL files that still need to be archived.\n\nCan grow under write load but should not increase over longer periods of time.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 7, "x": 0, - "y": 113 + "y": 129 }, + "hiddenSeries": false, "id": 51, "legend": { "avg": false, @@ -4182,7 +6048,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4202,6 +6072,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "WAL Files Ready", "tooltip": { @@ -4249,13 +6120,21 @@ "dashes": false, "datasource": "prometheus", "description": "Successful and failed archive commands per minute.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 7, "x": 7, - "y": 113 + "y": 129 }, + "hiddenSeries": false, "id": 47, "legend": { "avg": false, @@ -4270,7 +6149,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4293,6 +6176,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "WAL Archiving per Minute [$rate_interval]", "tooltip": { @@ -4342,13 +6226,21 @@ "dashes": false, "datasource": "prometheus", "description": "The amount of data a stream receiver like a standby server lags behind the master.\n\nsend_lag: Data that still needs to be send (should be small).\n\nflush_lag: Data that was received but must be flushed to persistent storage (this data can be lost if the standby is terminated).\n\nreplay_lag: Data that still needs to be replayed by PostgreSQL on the standby (can lag behind during writes in asynchronous configurations).", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { "h": 7, "w": 10, "x": 14, - "y": 113 + "y": 129 }, + "hiddenSeries": false, "id": 61, "legend": { "alignAsTable": false, @@ -4367,7 +6259,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4413,6 +6309,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Replication Lag", "tooltip": { @@ -4453,11 +6350,12 @@ }, { "collapsed": false, + "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 120 + "y": 136 }, "id": 83, "panels": [], @@ -4472,13 +6370,21 @@ "dashes": false, "datasource": "prometheus", "description": "Statement average execution time", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 8, + "h": 11, "w": 8, "x": 0, - "y": 121 + "y": 137 }, + "hiddenSeries": false, "id": 57, "legend": { "alignAsTable": false, @@ -4489,7 +6395,7 @@ "max": false, "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, "values": false }, @@ -4497,7 +6403,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4518,6 +6428,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Top $ntop_relations Statements by Average Execution Time [$rate_interval] - $datname", "tooltip": { @@ -4563,13 +6474,21 @@ "dashes": false, "datasource": "prometheus", "description": "Statement execution time per second", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 8, + "h": 11, "w": 8, "x": 8, - "y": 121 + "y": 137 }, + "hiddenSeries": false, "id": 98, "legend": { "alignAsTable": false, @@ -4580,7 +6499,7 @@ "max": false, "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, "values": false }, @@ -4588,7 +6507,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4609,6 +6532,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Top $ntop_relations Statements by Total Time [$rate_interval] - $datname", "tooltip": { @@ -4654,13 +6578,21 @@ "dashes": false, "datasource": "prometheus", "description": "Statements called per second", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 8, + "h": 11, "w": 8, "x": 16, - "y": 121 + "y": 137 }, + "hiddenSeries": false, "id": 59, "legend": { "alignAsTable": false, @@ -4671,7 +6603,7 @@ "max": false, "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, "values": false }, @@ -4679,7 +6611,11 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "alertThreshold": true + }, "percentage": false, + "pluginVersion": "7.4.3", "pointradius": 5, "points": false, "renderer": "flot", @@ -4700,6 +6636,7 @@ ], "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, "title": "Top $ntop_relations Statements by Calls [$rate_interval] - $datname", "tooltip": { @@ -4721,7 +6658,7 @@ "label": null, "logBase": 1, "max": null, - "min": null, + "min": "0", "show": true }, { @@ -4741,13 +6678,19 @@ { "columns": [], "datasource": "prometheus", - "description": "Shows how the total time increase over the last $rate_interval.", + "description": "Shows how long statements took in the chosen time period.", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, "fontSize": "100%", "gridPos": { "h": 12, "w": 24, "x": 0, - "y": 129 + "y": 148 }, "id": 58, "links": [], @@ -4761,12 +6704,14 @@ "styles": [ { "alias": "Time", + "align": "auto", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "Time", "type": "hidden" }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4782,6 +6727,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4797,6 +6743,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4812,6 +6759,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4827,6 +6775,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4842,6 +6791,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4857,6 +6807,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4872,6 +6823,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4887,6 +6839,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4902,6 +6855,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4917,6 +6871,7 @@ }, { "alias": "Total Time", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4932,6 +6887,7 @@ }, { "alias": "Query", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4949,6 +6905,7 @@ }, { "alias": "Database", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4964,6 +6921,7 @@ }, { "alias": "User", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4979,6 +6937,7 @@ }, { "alias": "", + "align": "auto", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -4995,8 +6954,9 @@ ], "targets": [ { - "expr": "increase(sql_pg_stat_statements{job=~'$job', host=~'$host', sql_job=~'$cluster', host=~'$host', col='total_time', datname=~'$datname'}[$rate_interval])", + "expr": "topk($ntop_relations, increase(sql_pg_stat_statements{job=~'$job', host=~'$host', sql_job=~'$cluster', host=~'$host', col='total_time', datname=~'$datname'}[$__range]))", "format": "table", + "instant": true, "interval": "", "intervalFactor": 2, "legendFormat": "", @@ -5004,15 +6964,40 @@ "step": 2 } ], - "timeFrom": "1s", + "timeFrom": null, "timeShift": null, - "title": "Statements by Total Time Increase [$rate_interval] - $datname", + "title": "Top $ntop_relations Statements by Total Time - $datname", "transform": "table", - "type": "table" + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Time": 0, + "Value": 10, + "col": 1, + "database": 2, + "datname": 3, + "driver": 6, + "host": 7, + "instance": 8, + "job": 9, + "query": 11, + "queryid": 12, + "sql_job": 13, + "usename": 4, + "user": 5 + }, + "renameByName": {} + } + } + ], + "type": "table-old" } ], "refresh": "1m", - "schemaVersion": 16, + "schemaVersion": 27, "style": "dark", "tags": [ "prometheus", @@ -5024,17 +7009,28 @@ "list": [ { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "localhost", + "value": "localhost" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": false, "label": "Server", "multi": false, "name": "job", "options": [], - "query": "label_values(sql_settings{col='max_connections'}, job)", + "query": { + "query": "label_values(sql_settings{col='max_connections'}, job)", + "refId": "prometheus-job-Variable-Query" + }, "refresh": 2, "regex": "", + "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", "tags": [], @@ -5044,17 +7040,28 @@ }, { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "11/main", + "value": "11/main" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": false, "label": "Cluster", "multi": false, "name": "cluster", "options": [], - "query": "label_values(sql_settings{job='$job'}, sql_job)", + "query": { + "query": "label_values(sql_settings{job='$job'}, sql_job)", + "refId": "prometheus-cluster-Variable-Query" + }, "refresh": 2, "regex": "", + "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tags": [], @@ -5064,17 +7071,28 @@ }, { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 2, "includeAll": true, "label": "PostgreSQL Port", "multi": false, "name": "host", "options": [], - "query": "label_values(sql_settings{job='$job'}, host)", + "query": { + "query": "label_values(sql_settings{job='$job'}, host)", + "refId": "prometheus-host-Variable-Query" + }, "refresh": 2, "regex": "", + "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tags": [], @@ -5084,17 +7102,28 @@ }, { "allValue": "", - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": true, "label": "Database", "multi": false, "name": "datname", "options": [], - "query": "label_values(sql_pg_stat_database{col='dbsize', host=~'$host', sql_job=~'$cluster'}, datname)", + "query": { + "query": "label_values(sql_pg_stat_database{col='dbsize', host=~'$host', sql_job=~'$cluster'}, datname)", + "refId": "prometheus-datname-Variable-Query" + }, "refresh": 2, "regex": "", + "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tags": [], @@ -5107,9 +7136,12 @@ "auto_count": 30, "auto_min": "10s", "current": { + "selected": false, "text": "5m", "value": "5m" }, + "description": null, + "error": null, "hide": 0, "label": "Rate Interval", "name": "rate_interval", @@ -5142,21 +7174,33 @@ ], "query": "1m,5m,10m,30m,1h", "refresh": 2, + "skipUrlSync": false, "type": "interval" }, { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": true, "label": "Disk", "multi": true, "name": "disk", "options": [], - "query": "label_values(node_disk_written_bytes_total, device)", + "query": { + "query": "label_values(node_disk_written_bytes_total, device)", + "refId": "prometheus-disk-Variable-Query" + }, "refresh": 2, "regex": "", + "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", "tags": [], @@ -5171,6 +7215,8 @@ "text": "5", "value": "5" }, + "description": null, + "error": null, "hide": 0, "includeAll": false, "label": "Top k", @@ -5214,21 +7260,33 @@ } ], "query": "1,3,5,10,20,50,100", + "skipUrlSync": false, "type": "custom" }, { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": true, "label": "Interface", "multi": false, "name": "interface", "options": [], - "query": "label_values(node_network_receive_bytes_total, device)", + "query": { + "query": "label_values(node_network_receive_bytes_total, device)", + "refId": "prometheus-interface-Variable-Query" + }, "refresh": 2, "regex": "", + "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", "tags": [], @@ -5238,17 +7296,28 @@ }, { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": true, "label": "Filesystem", "multi": true, "name": "filesystem", "options": [], - "query": "label_values(node_filesystem_size_bytes{job='$job'}, mountpoint)", + "query": { + "query": "label_values(node_filesystem_size_bytes{job='$job'}, mountpoint)", + "refId": "prometheus-filesystem-Variable-Query" + }, "refresh": 2, "regex": "(?!/media).*", + "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tags": [], @@ -5258,17 +7327,28 @@ }, { "allValue": null, - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "prometheus", + "definition": "", + "description": null, + "error": null, "hide": 0, "includeAll": true, "label": "Streaming Receiver", "multi": false, "name": "application_name", "options": [], - "query": "label_values(sql_pg_stat_replication{host=~'$host', sql_job=~'$cluster'}, application_name)", + "query": { + "query": "label_values(sql_pg_stat_replication{host=~'$host', sql_job=~'$cluster'}, application_name)", + "refId": "prometheus-application_name-Variable-Query" + }, "refresh": 2, "regex": "^.+.+", + "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tags": [], diff --git a/sql-exporter/queries.yml b/sql-exporter/queries.yml index bed97a5..5edc8f4 100644 --- a/sql-exporter/queries.yml +++ b/sql-exporter/queries.yml @@ -1,23 +1,99 @@ # queries run once per cluster (via the 'postgres' database) +- name: "server" + help: "Server version and start time" + scope: cluster + labels: + - "server_version" + values: + - "server_start_time" + query: >- + SELECT + split_part(current_setting('server_version'), ' ', 1) AS server_version, + extract(epoch FROM pg_postmaster_start_time())::float AS server_start_time + - name: "settings" help: "PostgreSQL settings" scope: cluster + min_version: 9.5 + max_version: 10 labels: - "settings" values: + - "data_checksums" - "max_connections" - "autovacuum_freeze_max_age" - "superuser_reserved_connections" - "max_wal_senders" - "max_prepared_transactions" + - "max_worker_processes" + - "random_page_cost" + - "seq_page_cost" + - "checkpoint_timeout" + - "work_mem" + - "maintenance_work_mem" + - "shared_buffers" + - "effective_cache_size" + - "max_wal_size" query: >- SELECT + current_setting('data_checksums')::bool::int::float AS data_checksums, current_setting('max_connections')::float AS max_connections, current_setting('autovacuum_freeze_max_age')::float AS autovacuum_freeze_max_age, current_setting('superuser_reserved_connections')::float AS superuser_reserved_connections, current_setting('max_wal_senders')::float AS max_wal_senders, - current_setting('max_prepared_transactions')::float AS max_prepared_transactions + current_setting('max_prepared_transactions')::float AS max_prepared_transactions, + current_setting('max_worker_processes')::float AS max_worker_processes, + current_setting('random_page_cost')::float AS random_page_cost, + current_setting('seq_page_cost')::float AS seq_page_cost, + (SELECT setting FROM pg_settings WHERE name = 'checkpoint_timeout') AS checkpoint_timeout, + pg_size_bytes(current_setting('work_mem'))::float AS work_mem, + pg_size_bytes(current_setting('maintenance_work_mem'))::float AS maintenance_work_mem, + pg_size_bytes(current_setting('shared_buffers'))::float AS shared_buffers, + pg_size_bytes(current_setting('effective_cache_size'))::float AS effective_cache_size, + pg_size_bytes(current_setting('max_wal_size'))::float AS max_wal_size + +- name: "settings" + help: "PostgreSQL settings" + scope: cluster + min_version: 11 + labels: + - "settings" + values: + - "data_checksums" + - "jit" + - "max_connections" + - "autovacuum_freeze_max_age" + - "superuser_reserved_connections" + - "max_wal_senders" + - "max_prepared_transactions" + - "max_worker_processes" + - "random_page_cost" + - "seq_page_cost" + - "checkpoint_timeout" + - "work_mem" + - "maintenance_work_mem" + - "shared_buffers" + - "effective_cache_size" + - "max_wal_size" + query: >- + SELECT + current_setting('data_checksums')::bool::int::float AS data_checksums, + current_setting('jit')::bool::int::float AS jit, + current_setting('max_connections')::float AS max_connections, + current_setting('autovacuum_freeze_max_age')::float AS autovacuum_freeze_max_age, + current_setting('superuser_reserved_connections')::float AS superuser_reserved_connections, + current_setting('max_wal_senders')::float AS max_wal_senders, + current_setting('max_prepared_transactions')::float AS max_prepared_transactions, + current_setting('max_worker_processes')::float AS max_worker_processes, + current_setting('random_page_cost')::float AS random_page_cost, + current_setting('seq_page_cost')::float AS seq_page_cost, + (SELECT setting FROM pg_settings WHERE name = 'checkpoint_timeout') AS checkpoint_timeout, + pg_size_bytes(current_setting('work_mem'))::float AS work_mem, + pg_size_bytes(current_setting('maintenance_work_mem'))::float AS maintenance_work_mem, + pg_size_bytes(current_setting('shared_buffers'))::float AS shared_buffers, + pg_size_bytes(current_setting('effective_cache_size'))::float AS effective_cache_size, + pg_size_bytes(current_setting('max_wal_size'))::float AS max_wal_size - name: "pg_locks" help: "locks held" @@ -37,6 +113,58 @@ help: "database statistics" scope: cluster min_version: 9.2 + max_version: 11 + type: "counter" + labels: + - "datname" + values: + - "numbackends:count" + - "xact_commit" + - "xact_rollback" + - "blks_read" + - "blks_hit" + - "tup_returned" + - "tup_fetched" + - "tup_inserted" + - "tup_updated" + - "tup_deleted" + - "conflicts" + - "temp_files" + - "temp_bytes" + - "deadlocks" + - "blk_read_time" + - "blk_write_time" + - "freeze_age" + - "dbsize" + query: >- + SELECT + s.datname::text, + numbackends::float, + xact_commit::float, + xact_rollback::float, + blks_read::float, + blks_hit::float, + tup_returned::float, + tup_fetched::float, + tup_inserted::float, + tup_updated::float, + tup_deleted::float, + conflicts::float, + temp_files::float, + temp_bytes::float, + deadlocks::float, + blk_read_time, + blk_write_time, + age(d.datfrozenxid) AS freeze_age, + pg_database_size(s.datname)::float AS dbsize + FROM pg_stat_database s + LEFT JOIN pg_database d ON d.datname = s.datname + WHERE NOT s.datname ~ '^template(0|1)$' + +- name: "pg_stat_database" + help: "database statistics" + scope: cluster + min_version: 12 type: "counter" labels: - "datname" @@ -58,6 +186,7 @@ - "blk_read_time" - "blk_write_time" - "freeze_age" + - "checksum_failures" - "dbsize" query: >- SELECT @@ -79,6 +208,7 @@ blk_read_time, blk_write_time, age(d.datfrozenxid) AS freeze_age, + coalesce(checksum_failures::float, 0) AS checksum_failures, pg_database_size(s.datname)::float AS dbsize FROM pg_stat_database s LEFT JOIN pg_database d ON d.datname = s.datname diff --git a/sql-exporter/wal.yml b/sql-exporter/wal.yml index dbb2dd9..90fb11b 100644 --- a/sql-exporter/wal.yml +++ b/sql-exporter/wal.yml @@ -1,15 +1,17 @@ # queries run once per cluster (via the 'postgres' database) - name: "checkpoints" - help: "requested and timed checkpoints" + help: "requested/timed checkpoints and checkpoint buffers" scope: cluster values: - "timed" - "requested" + - "buffers" query: >- SELECT pg_stat_get_bgwriter_timed_checkpoints() timed, - pg_stat_get_bgwriter_requested_checkpoints() requested + pg_stat_get_bgwriter_requested_checkpoints() requested, + pg_stat_get_bgwriter_buf_written_checkpoints() buffers - name: "LastCheckpointDistance" help: "distance to the last checkpoint"