From c3eec8d0a51543a03750baff2934f4f6edfe6cb6 Mon Sep 17 00:00:00 2001 From: "dementii.priadko" <45518657+DEMNERD@users.noreply.github.com> Date: Tue, 4 Nov 2025 02:22:03 +0200 Subject: [PATCH 1/6] Introduce a pg_stat_slru metric --- config/pgwatch-prometheus/metrics.yml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/config/pgwatch-prometheus/metrics.yml b/config/pgwatch-prometheus/metrics.yml index aaddad7..ed87202 100644 --- a/config/pgwatch-prometheus/metrics.yml +++ b/config/pgwatch-prometheus/metrics.yml @@ -1093,6 +1093,37 @@ metrics: - latest_end_time - upstream_node statement_timeout_seconds: 15 + pg_stat_slru: + description: > + Retrieves statistics from the PostgreSQL `pg_stat_slru` view for SLRU (Simple Least Recently Used) caches. + It tracks various SLRU caches like subtrans, multixact_offset, multixact_member, notify, serial, and clog. + Each cache reports blocks zeroed, hit, read, written, exists checks, flushes, truncates, and last stats reset time. + This metric helps administrators monitor SLRU cache performance and identify potential issues with transaction ID wraparound or other system caches. + sqls: + 11: "; -- not available before PG 13" + 13: |- + select /* pgwatch_generated */ + current_database() as tag_datname, + name as tag_name, + blks_zeroed, + blks_hit, + blks_read, + blks_written, + blks_exists, + flushes, + truncates, + extract(epoch from stats_reset)::int8 as stats_reset_epoch + from pg_stat_slru + gauges: + - blks_zeroed + - blks_hit + - blks_read + - blks_written + - blks_exists + - flushes + - truncates + - stats_reset_epoch + statement_timeout_seconds: 15 pg_stuck_idle_in_transaction: sqls: 11: | @@ -2193,6 +2224,7 @@ presets: pg_stat_all_indexes: 30 pg_stat_statements: 30 pg_stat_replication: 30 + pg_stat_slru: 30 pg_statio_all_tables: 30 pg_statio_all_indexes: 30 pg_total_relation_size: 30 From 7e6b0955c1826304e5e76368cc2503897e2199da Mon Sep 17 00:00:00 2001 From: "dementii.priadko" <45518657+DEMNERD@users.noreply.github.com> Date: Tue, 4 Nov 2025 02:43:31 +0200 Subject: [PATCH 2/6] Added slru stats to the first dashboard --- ...Dashboard_1_Node_performance_overview.json | 727 +++++++++++++++++- 1 file changed, 725 insertions(+), 2 deletions(-) diff --git a/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json b/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json index 3857460..6a2474e 100644 --- a/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json +++ b/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": 10, + "id": 2, "links": [], "panels": [ { @@ -4612,6 +4612,729 @@ "pluginVersion": "12.0.2", "title": "", "type": "text" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 200 + }, + "id": 53, + "panels": [], + "title": "SLRU stats", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 201 + }, + "id": 46, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "editorMode": "code", + "expr": "irate(pgwatch_pg_stat_slru_blks_hit{cluster='$cluster_name', node_name='$node_name', datname=\"$db_name\"}[$__rate_interval])", + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A" + } + ], + "title": "SLRU blocks hit", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 212 + }, + "id": 52, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_exists{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks exist", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 223 + }, + "id": 47, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_read{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks read", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 234 + }, + "id": 48, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_written{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks written", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 245 + }, + "id": 49, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "code", + "expr": "irate(pgwatch_pg_stat_slru_blks_zeroed{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks zeroed", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 256 + }, + "id": 50, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_truncates{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU truncates", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 267 + }, + "id": 51, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_flushes{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU flushes", + "type": "timeseries" } ], "preload": false, @@ -4683,5 +5406,5 @@ "timezone": "utc", "title": "01. Single node performance overview (high-level)", "uid": "f90500a0-a12e-4081-a2f0-07ed96f27915", - "version": 24 + "version": 3 } \ No newline at end of file From 6e095eb7576dfd8c2a719db01d1fffe2d59523b1 Mon Sep 17 00:00:00 2001 From: "dementii.priadko" <45518657+DEMNERD@users.noreply.github.com> Date: Tue, 4 Nov 2025 03:24:11 +0200 Subject: [PATCH 3/6] Moved slru stats to a new dashboard --- .../grafana/dashboards/Dashboard_12_SLRU.json | 943 ++++++++++++++++++ ...Dashboard_1_Node_performance_overview.json | 723 -------------- 2 files changed, 943 insertions(+), 723 deletions(-) create mode 100644 config/grafana/dashboards/Dashboard_12_SLRU.json diff --git a/config/grafana/dashboards/Dashboard_12_SLRU.json b/config/grafana/dashboards/Dashboard_12_SLRU.json new file mode 100644 index 0000000..e2f71f0 --- /dev/null +++ b/config/grafana/dashboards/Dashboard_12_SLRU.json @@ -0,0 +1,943 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": null, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [], + "title": "SLRU cache hit rates", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Cache hit rate for each SLRU cache. Higher is better (less disk I/O).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "last", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_hit[5m]) / (rate(pgwatch_pg_stat_slru_blks_hit[5m]) + rate(pgwatch_pg_stat_slru_blks_read[5m])) * 100", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "SLRU cache hit rate by cache type", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Latest cache hit rate values for each SLRU cache.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red" + }, + { + "color": "yellow", + "value": 80 + }, + { + "color": "green", + "value": 95 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 3, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_hit[5m]) / (rate(pgwatch_pg_stat_slru_blks_hit[5m]) + rate(pgwatch_pg_stat_slru_blks_read[5m])) * 100", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "Current SLRU cache hit rates", + "type": "gauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 4, + "panels": [], + "title": "SLRU disk I/O", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of blocks read from disk per second by cache type. Lower is better.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 5, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_read[5m])", + "legendFormat": "{{name}} reads", + "refId": "A" + } + ], + "title": "SLRU blocks read from disk per second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of blocks written to disk per second by cache type.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 10 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_written[5m])", + "legendFormat": "{{name}} writes", + "refId": "A" + } + ], + "title": "SLRU blocks written to disk per second", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 7, + "panels": [], + "title": "SLRU cache operations", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of cache hits per second by cache type.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 19 + }, + "id": 8, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_hit[5m])", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "SLRU cache hits per second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of blocks zeroed (initialized) per second by cache type.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 19 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_zeroed[5m])", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "SLRU blocks zeroed per second", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 10, + "panels": [], + "title": "SLRU maintenance operations", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of flush operations per second by cache type. Flushes write dirty data to disk.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 28 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_flushes[5m])", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "SLRU flushes per second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of truncate operations per second by cache type. Truncates remove old data from caches.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 28 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_truncates[5m])", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "SLRU truncates per second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "description": "Rate of existence checks per second by cache type.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 36 + }, + "id": 13, + "options": { + "legend": { + "calcs": [ + "last", + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "expr": "rate(pgwatch_pg_stat_slru_blks_exists[5m])", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "SLRU existence checks per second", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "postgres", + "slru", + "cache", + "performance" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "12. Experimental: SLRU cache statistics", + "uid": "slru_stats", + "version": 1, + "weekStart": "" +} + diff --git a/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json b/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json index 6a2474e..16eec4a 100644 --- a/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json +++ b/config/grafana/dashboards/Dashboard_1_Node_performance_overview.json @@ -4612,729 +4612,6 @@ "pluginVersion": "12.0.2", "title": "", "type": "text" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 200 - }, - "id": 53, - "panels": [], - "title": "SLRU stats", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 201 - }, - "id": 46, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "editorMode": "code", - "expr": "irate(pgwatch_pg_stat_slru_blks_hit{cluster='$cluster_name', node_name='$node_name', datname=\"$db_name\"}[$__rate_interval])", - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A" - } - ], - "title": "SLRU blocks hit", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 212 - }, - "id": 52, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_blks_exists{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks exist", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 223 - }, - "id": 47, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_blks_read{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks read", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 234 - }, - "id": 48, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_blks_written{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks written", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 245 - }, - "id": 49, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "code", - "expr": "irate(pgwatch_pg_stat_slru_blks_zeroed{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks zeroed", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 256 - }, - "id": 50, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_truncates{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU truncates", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 267 - }, - "id": 51, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_flushes{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU flushes", - "type": "timeseries" } ], "preload": false, From 7b852abb2240932023e2019b98971233fbeef211 Mon Sep 17 00:00:00 2001 From: "dementii.priadko" <45518657+DEMNERD@users.noreply.github.com> Date: Tue, 4 Nov 2025 03:35:28 +0200 Subject: [PATCH 4/6] Fixed dashboard for slru --- .../grafana/dashboards/Dashboard_12_SLRU.json | 625 ++++++++---------- 1 file changed, 263 insertions(+), 362 deletions(-) diff --git a/config/grafana/dashboards/Dashboard_12_SLRU.json b/config/grafana/dashboards/Dashboard_12_SLRU.json index e2f71f0..68304d3 100644 --- a/config/grafana/dashboards/Dashboard_12_SLRU.json +++ b/config/grafana/dashboards/Dashboard_12_SLRU.json @@ -29,9 +29,9 @@ "x": 0, "y": 0 }, - "id": 1, + "id": 53, "panels": [], - "title": "SLRU cache hit rates", + "title": "SLRU stats", "type": "row" }, { @@ -39,7 +39,6 @@ "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Cache hit rate for each SLRU cache. Higher is better (less disk I/O).", "fieldConfig": { "defaults": { "color": { @@ -54,7 +53,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -63,12 +62,12 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", @@ -79,8 +78,6 @@ } }, "mappings": [], - "max": 100, - "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -93,21 +90,22 @@ } ] }, - "unit": "percent" + "unit": "ops" }, "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, + "h": 11, + "w": 24, "x": 0, "y": 1 }, - "id": 2, + "id": 46, "options": { "legend": { "calcs": [ - "last", + "min", + "max", "mean" ], "displayMode": "table", @@ -115,23 +113,23 @@ "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_hit[5m]) / (rate(pgwatch_pg_stat_slru_blks_hit[5m]) + rate(pgwatch_pg_stat_slru_blks_read[5m])) * 100", + "editorMode": "code", + "expr": "irate(pgwatch_pg_stat_slru_blks_hit{cluster='$cluster_name', node_name='$node_name', datname=\"$db_name\"}[$__rate_interval])", + "interval": "10", "legendFormat": "{{name}}", + "range": true, "refId": "A" } ], - "title": "SLRU cache hit rate by cache type", + "title": "SLRU blocks hit", "type": "timeseries" }, { @@ -139,91 +137,6 @@ "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Latest cache hit rate values for each SLRU cache.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red" - }, - { - "color": "yellow", - "value": 80 - }, - { - "color": "green", - "value": 95 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 3, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_hit[5m]) / (rate(pgwatch_pg_stat_slru_blks_hit[5m]) + rate(pgwatch_pg_stat_slru_blks_read[5m])) * 100", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "title": "Current SLRU cache hit rates", - "type": "gauge" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 4, - "panels": [], - "title": "SLRU disk I/O", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "description": "Rate of blocks read from disk per second by cache type. Lower is better.", "fieldConfig": { "defaults": { "color": { @@ -238,7 +151,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -247,16 +160,16 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -280,41 +193,45 @@ "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, + "h": 11, + "w": 24, "x": 0, - "y": 10 + "y": 12 }, - "id": 5, + "id": 52, "options": { "legend": { "calcs": [ - "last", - "mean", - "max" + "min", + "max", + "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_read[5m])", - "legendFormat": "{{name}} reads", - "refId": "A" + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_exists{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false } ], - "title": "SLRU blocks read from disk per second", + "title": "SLRU blocks exist", "type": "timeseries" }, { @@ -322,7 +239,6 @@ "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Rate of blocks written to disk per second by cache type.", "fieldConfig": { "defaults": { "color": { @@ -337,7 +253,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -346,16 +262,16 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -379,149 +295,45 @@ "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 10 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ - "last", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_written[5m])", - "legendFormat": "{{name}} writes", - "refId": "A" - } - ], - "title": "SLRU blocks written to disk per second", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, + "h": 11, "w": 24, "x": 0, - "y": 18 - }, - "id": 7, - "panels": [], - "title": "SLRU cache operations", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "description": "Rate of cache hits per second by cache type.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 19 + "y": 23 }, - "id": 8, + "id": 47, "options": { "legend": { "calcs": [ - "last", - "mean", - "max" + "min", + "max", + "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_hit[5m])", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_read{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", "legendFormat": "{{name}}", - "refId": "A" + "range": true, + "refId": "A", + "useBackend": false } ], - "title": "SLRU cache hits per second", + "title": "SLRU blocks read", "type": "timeseries" }, { @@ -529,7 +341,6 @@ "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Rate of blocks zeroed (initialized) per second by cache type.", "fieldConfig": { "defaults": { "color": { @@ -544,7 +355,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -553,16 +364,16 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -574,6 +385,10 @@ "steps": [ { "color": "green" + }, + { + "color": "red", + "value": 80 } ] }, @@ -582,62 +397,52 @@ "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 19 + "h": 11, + "w": 24, + "x": 0, + "y": 34 }, - "id": 9, + "id": 48, "options": { "legend": { "calcs": [ - "last", - "mean", - "max" + "min", + "max", + "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_zeroed[5m])", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_written{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", "legendFormat": "{{name}}", - "refId": "A" + "range": true, + "refId": "A", + "useBackend": false } ], - "title": "SLRU blocks zeroed per second", + "title": "SLRU blocks written", "type": "timeseries" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 27 - }, - "id": 10, - "panels": [], - "title": "SLRU maintenance operations", - "type": "row" - }, { "datasource": { "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Rate of flush operations per second by cache type. Flushes write dirty data to disk.", "fieldConfig": { "defaults": { "color": { @@ -652,7 +457,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -661,16 +466,16 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -682,6 +487,10 @@ "steps": [ { "color": "green" + }, + { + "color": "red", + "value": 80 } ] }, @@ -690,41 +499,45 @@ "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, + "h": 11, + "w": 24, "x": 0, - "y": 28 + "y": 45 }, - "id": 11, + "id": 49, "options": { "legend": { "calcs": [ - "last", - "mean", - "max" + "min", + "max", + "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_flushes[5m])", + "disableTextWrap": false, + "editorMode": "code", + "expr": "irate(pgwatch_pg_stat_slru_blks_zeroed{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", "legendFormat": "{{name}}", - "refId": "A" + "range": true, + "refId": "A", + "useBackend": false } ], - "title": "SLRU flushes per second", + "title": "SLRU blocks zeroed", "type": "timeseries" }, { @@ -732,7 +545,6 @@ "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Rate of truncate operations per second by cache type. Truncates remove old data from caches.", "fieldConfig": { "defaults": { "color": { @@ -747,7 +559,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -756,16 +568,16 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -777,6 +589,10 @@ "steps": [ { "color": "green" + }, + { + "color": "red", + "value": 80 } ] }, @@ -785,41 +601,45 @@ "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 28 + "h": 11, + "w": 24, + "x": 0, + "y": 56 }, - "id": 12, + "id": 50, "options": { "legend": { "calcs": [ - "last", - "mean", - "max" + "min", + "max", + "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_truncates[5m])", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_truncates{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", "legendFormat": "{{name}}", - "refId": "A" + "range": true, + "refId": "A", + "useBackend": false } ], - "title": "SLRU truncates per second", + "title": "SLRU truncates", "type": "timeseries" }, { @@ -827,7 +647,6 @@ "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "description": "Rate of existence checks per second by cache type.", "fieldConfig": { "defaults": { "color": { @@ -842,7 +661,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -851,16 +670,16 @@ }, "insertNulls": false, "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, + "lineWidth": 1, + "pointSize": 1, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", + "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -872,6 +691,10 @@ "steps": [ { "color": "green" + }, + { + "color": "red", + "value": 80 } ] }, @@ -880,41 +703,45 @@ "overrides": [] }, "gridPos": { - "h": 8, + "h": 11, "w": 24, "x": 0, - "y": 36 + "y": 67 }, - "id": 13, + "id": 51, "options": { "legend": { "calcs": [ - "last", - "mean", - "max" + "min", + "max", + "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { - "mode": "multi", - "sort": "desc" + "hideZeros": false, + "mode": "single", + "sort": "none" } }, "pluginVersion": "12.0.2", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "expr": "rate(pgwatch_pg_stat_slru_blks_exists[5m])", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_flushes{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", "legendFormat": "{{name}}", - "refId": "A" + "range": true, + "refId": "A", + "useBackend": false } ], - "title": "SLRU existence checks per second", + "title": "SLRU flushes", "type": "timeseries" } ], @@ -927,7 +754,82 @@ "performance" ], "templating": { - "list": [] + "list": [ + { + "current": { + "selected": false, + "text": "local", + "value": "local" + }, + "hide": 0, + "includeAll": false, + "label": "Cluster", + "multi": false, + "name": "cluster_name", + "options": [ + { + "selected": true, + "text": "local", + "value": "local" + } + ], + "query": "local", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "node-01", + "value": "node-01" + }, + "hide": 0, + "includeAll": false, + "label": "Node", + "multi": false, + "name": "node_name", + "options": [ + { + "selected": true, + "text": "node-01", + "value": "node-01" + } + ], + "query": "node-01", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "target_database", + "value": "target_database" + }, + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "definition": "label_values(pgwatch_db_stats_numbackends{cluster=\"$cluster_name\", node_name=\"$node_name\"}, datname)", + "hide": 0, + "includeAll": false, + "label": "Database", + "multi": false, + "name": "db_name", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(pgwatch_db_stats_numbackends{cluster=\"$cluster_name\", node_name=\"$node_name\"}, datname)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] }, "time": { "from": "now-1h", @@ -940,4 +842,3 @@ "version": 1, "weekStart": "" } - From ff3889b2f81dbcd8b44837d10b3d56cd19c9669d Mon Sep 17 00:00:00 2001 From: "dementii.priadko" <45518657+DEMNERD@users.noreply.github.com> Date: Tue, 4 Nov 2025 03:45:13 +0200 Subject: [PATCH 5/6] Fixed SLRU dashboard variables --- .../grafana/dashboards/Dashboard_12_SLRU.json | 1534 ++++++++--------- 1 file changed, 755 insertions(+), 779 deletions(-) diff --git a/config/grafana/dashboards/Dashboard_12_SLRU.json b/config/grafana/dashboards/Dashboard_12_SLRU.json index 68304d3..0fd939c 100644 --- a/config/grafana/dashboards/Dashboard_12_SLRU.json +++ b/config/grafana/dashboards/Dashboard_12_SLRU.json @@ -1,844 +1,820 @@ { - "annotations": { - "list": [ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": 13, + "links": [], + "panels": [ { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": null, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 + "id": 53, + "panels": [], + "title": "SLRU stats", + "type": "row" }, - "id": 53, - "panels": [], - "title": "SLRU stats", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - { - "color": "red", - "value": 80 + "thresholdsStyle": { + "mode": "off" } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 1 - }, - "id": 46, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "editorMode": "code", - "expr": "irate(pgwatch_pg_stat_slru_blks_hit{cluster='$cluster_name', node_name='$node_name', datname=\"$db_name\"}[$__rate_interval])", - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A" - } - ], - "title": "SLRU blocks hit", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] }, - "thresholdsStyle": { - "mode": "off" - } + "unit": "ops" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 46, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "unit": "ops" + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 12 + "pluginVersion": "12.0.2", + "targets": [ + { + "editorMode": "code", + "expr": "irate(pgwatch_pg_stat_slru_blks_hit{cluster='$cluster_name', node_name='$node_name', datname=\"$db_name\"}[$__rate_interval])", + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A" + } + ], + "title": "SLRU blocks hit", + "type": "timeseries" }, - "id": 52, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_blks_exists{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks exist", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] }, - "thresholdsStyle": { - "mode": "off" - } + "unit": "ops" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 52, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "unit": "ops" + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 23 + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_exists{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks exist", + "type": "timeseries" }, - "id": 47, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_blks_read{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks read", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] }, - "thresholdsStyle": { - "mode": "off" - } + "unit": "ops" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 47, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "unit": "ops" + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 34 + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_read{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks read", + "type": "timeseries" }, - "id": 48, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_blks_written{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks written", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] }, - "thresholdsStyle": { - "mode": "off" - } + "unit": "ops" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 34 + }, + "id": 48, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "unit": "ops" + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 45 + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_blks_written{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks written", + "type": "timeseries" }, - "id": 49, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "code", - "expr": "irate(pgwatch_pg_stat_slru_blks_zeroed{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU blocks zeroed", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] }, - "thresholdsStyle": { - "mode": "off" - } + "unit": "ops" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 45 + }, + "id": 49, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "unit": "ops" + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 56 + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "code", + "expr": "irate(pgwatch_pg_stat_slru_blks_zeroed{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU blocks zeroed", + "type": "timeseries" }, - "id": 50, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + { + "datasource": { + "type": "prometheus", + "uid": "P7A0D6631BB10B34F" }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_truncates{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU truncates", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "P7A0D6631BB10B34F" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - { - "color": "red", - "value": 80 + "thresholdsStyle": { + "mode": "off" } - ] + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" }, - "unit": "ops" + "overrides": [] }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 67 - }, - "id": 51, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 56 }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.0.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "irate(pgwatch_pg_stat_slru_flushes{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", - "fullMetaSearch": false, - "includeNullMetadata": true, - "interval": "10", - "legendFormat": "{{name}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "SLRU flushes", - "type": "timeseries" - } - ], - "refresh": "30s", - "schemaVersion": 39, - "tags": [ - "postgres", - "slru", - "cache", - "performance" - ], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "local", - "value": "local" - }, - "hide": 0, - "includeAll": false, - "label": "Cluster", - "multi": false, - "name": "cluster_name", - "options": [ - { - "selected": true, - "text": "local", - "value": "local" + "id": 50, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" } - ], - "query": "local", - "queryValue": "", - "skipUrlSync": false, - "type": "custom" - }, - { - "current": { - "selected": false, - "text": "node-01", - "value": "node-01" }, - "hide": 0, - "includeAll": false, - "label": "Node", - "multi": false, - "name": "node_name", - "options": [ + "pluginVersion": "12.0.2", + "targets": [ { - "selected": true, - "text": "node-01", - "value": "node-01" + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_truncates{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false } ], - "query": "node-01", - "queryValue": "", - "skipUrlSync": false, - "type": "custom" + "title": "SLRU truncates", + "type": "timeseries" }, { - "current": { - "selected": false, - "text": "target_database", - "value": "target_database" - }, "datasource": { "type": "prometheus", "uid": "P7A0D6631BB10B34F" }, - "definition": "label_values(pgwatch_db_stats_numbackends{cluster=\"$cluster_name\", node_name=\"$node_name\"}, datname)", - "hide": 0, - "includeAll": false, - "label": "Database", - "multi": false, - "name": "db_name", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(pgwatch_db_stats_numbackends{cluster=\"$cluster_name\", node_name=\"$node_name\"}, datname)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 67 + }, + "id": 51, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" + "pluginVersion": "12.0.2", + "targets": [ + { + "disableTextWrap": false, + "editorMode": "builder", + "expr": "irate(pgwatch_pg_stat_slru_flushes{cluster=\"$cluster_name\", node_name=\"$node_name\", datname=\"$db_name\"}[$__rate_interval])", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "10", + "legendFormat": "{{name}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "SLRU flushes", + "type": "timeseries" } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "12. Experimental: SLRU cache statistics", - "uid": "slru_stats", - "version": 1, - "weekStart": "" -} + ], + "preload": false, + "refresh": "30s", + "schemaVersion": 41, + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "default", + "value": "default" + }, + "definition": "label_values(pgwatch_settings_configured,cluster)", + "description": "", + "label": "Cluster", + "name": "cluster_name", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(pgwatch_settings_configured,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "current": { + "text": "postgres_ai", + "value": "postgres_ai" + }, + "definition": "label_values(pgwatch_settings_configured{cluster=\"$cluster_name\"},node_name)", + "label": "Node", + "name": "node_name", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(pgwatch_settings_configured{cluster=\"$cluster_name\"},node_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "current": { + "text": "workloaddb", + "value": "workloaddb" + }, + "definition": "label_values(pgwatch_pg_database_wraparound_age_datfrozenxid{cluster=\"$cluster_name\", node_name=\"$node_name\", datname!=\"template1\"},datname)", + "label": "DB name", + "name": "db_name", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(pgwatch_pg_database_wraparound_age_datfrozenxid{cluster=\"$cluster_name\", node_name=\"$node_name\", datname!=\"template1\"},datname)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "12. Experimental: SLRU cache statistics", + "uid": "slru_stats", + "version": 2 + } \ No newline at end of file From 87baf7f59da0d8966f751b6b9d205ee159f06651 Mon Sep 17 00:00:00 2001 From: Dementii Priadko Date: Tue, 4 Nov 2025 03:20:04 +0000 Subject: [PATCH 6/6] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Nikolay Samokhvalov --- config/grafana/dashboards/Dashboard_12_SLRU.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/grafana/dashboards/Dashboard_12_SLRU.json b/config/grafana/dashboards/Dashboard_12_SLRU.json index 0fd939c..d546619 100644 --- a/config/grafana/dashboards/Dashboard_12_SLRU.json +++ b/config/grafana/dashboards/Dashboard_12_SLRU.json @@ -814,7 +814,7 @@ }, "timepicker": {}, "timezone": "browser", - "title": "12. Experimental: SLRU cache statistics", + "title": "X - SLRU cache stats", "uid": "slru_stats", "version": 2 } \ No newline at end of file