diff --git a/grafana/postgres/v12/0-health-check.json b/grafana/postgres/v12/0-health-check.json index 980eac757e..31bc1cd0f4 100644 --- a/grafana/postgres/v12/0-health-check.json +++ b/grafana/postgres/v12/0-health-check.json @@ -387,7 +387,7 @@ "orderByTime": "ASC", "policy": "default", "rawQuery": true, - "rawSql": "select (data->>'server_version_num')::int8 as value \nfrom settings \nwhere dbname = '$dbname' and $__timeFilter(time) \norder by time \ndesc limit 1;", + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'server_version_num'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", "refId": "A", "resultFormat": "time_series", "select": [ @@ -1281,7 +1281,7 @@ "orderByTime": "ASC", "policy": "default", "rawQuery": true, - "rawSql": "WITH s(max_connections) AS (\n SELECT (data->>'max_connections')::int\n FROM settings\n WHERE $__timeFilter(time) AND dbname = '$dbname'\n ORDER BY time DESC\n LIMIT 1\n)\n\nSELECT round(((b.data->>'numbackends')::float / s.max_connections) * 100)\nFROM db_stats b, s\nWHERE $__timeFilter(b.time) AND b.dbname = '$dbname'\nORDER BY b.time DESC\nLIMIT 1", + "rawSql": "WITH s(max_connections) AS (\n SELECT (data->>'value')::int\n FROM settings_num\n WHERE $__timeFilter(time) AND dbname = '$dbname'\n AND tag_data->>'name' = 'max_connections'\n ORDER BY time DESC\n LIMIT 1\n)\nSELECT round(((b.data->>'numbackends')::float / s.max_connections) * 100)\nFROM db_stats b, s\nWHERE $__timeFilter(b.time) AND b.dbname = '$dbname'\nORDER BY b.time DESC\nLIMIT 1", "refId": "A", "resultFormat": "time_series", "select": [ @@ -3425,7 +3425,7 @@ "orderByTime": "ASC", "policy": "default", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n sum(count)\nFROM (\n\nSELECT * FROM (\n\nSELECT\n case when data->>'autovacuum' = 'off' then 1 else 0 end as count\nFROM\n settings\nWHERE\n dbname = '$dbname'\n AND time > now() - '1d'::interval\nORDER BY time DESC LIMIT 1\n\n) a\n\nUNION ALL\n\nSELECT * FROM (\n\nSELECT\n count(*)\nFROM\n table_stats\nWHERE\n dbname = '$dbname'\n AND time = (select max(time) from table_stats where dbname = '$dbname')\n AND (data->>'no_autovacuum')::int = 1\n\n) b\n\n) x;", + "rawSql": "SELECT\n 0 as time,\n sum(count)\nFROM (\n SELECT\n CASE WHEN (data->>'value')::float8 = 0 THEN 1 ELSE 0 END AS count\n FROM settings_num\n WHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum'\n AND time > now() - '1d'::interval\n ORDER BY time DESC LIMIT 1\n UNION ALL\n SELECT count(*)\n FROM table_stats\n WHERE dbname = '$dbname'\n AND time = (SELECT max(time) FROM table_stats WHERE dbname = '$dbname')\n AND (data->>'no_autovacuum')::int = 1\n) x", "refId": "A", "resultFormat": "time_series", "select": [ @@ -5193,7 +5193,7 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "### Brought to you by\n\n[![Cybertec – The PostgreSQL Database Company](https://cdn.jsdelivr.net/gh/cybertec-postgresql/pgwatch@master/docs/gallery/cybertec-logo-white-blue.svg)](https://www.cybertec-postgresql.com/en/)\n", + "content": "### Brought to you by\n\n[![Cybertec \u2013 The PostgreSQL Database Company](https://cdn.jsdelivr.net/gh/cybertec-postgresql/pgwatch@master/docs/gallery/cybertec-logo-white-blue.svg)](https://www.cybertec-postgresql.com/en/)\n", "mode": "markdown" }, "pluginVersion": "12.3.1", diff --git a/grafana/postgres/v12/change-events.json b/grafana/postgres/v12/change-events.json index 79ec1bac48..a2ca7531d2 100644 --- a/grafana/postgres/v12/change-events.json +++ b/grafana/postgres/v12/change-events.json @@ -1190,7 +1190,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "select\n (select time from settings where $__timeFilter(time) order by time desc limit 1) as \"Time\",\n key,\n value::text as value\nfrom (\n select * from jsonb_each((select data from settings where $__timeFilter(time) order by time desc limit 1))\n) x;", + "rawSql": "SELECT\n (SELECT max(time) FROM settings_num\n WHERE dbname = '$dbname' AND $__timeFilter(time)) AS \"Time\",\n tag_data->>'name' AS name,\n (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND time = (SELECT max(time) FROM settings_num\n WHERE dbname = '$dbname' AND $__timeFilter(time))\nORDER BY name", "refId": "A", "select": [ [ diff --git a/grafana/postgres/v12/postgres-version-overview.json b/grafana/postgres/v12/postgres-version-overview.json index beef106ce0..27fd0608af 100644 --- a/grafana/postgres/v12/postgres-version-overview.json +++ b/grafana/postgres/v12/postgres-version-overview.json @@ -145,7 +145,7 @@ "policy": "default", "query": "SELECT top(\"spread\", \"function_full_name\", \"oid\", $top) FROM (SELECT spread(\"total_time\") FROM \"sproc_stats\" WHERE $timeFilter AND \"dbname\" = '$dbname' GROUP BY time(3650d), \"function_full_name\", \"oid\" fill(none) ) WHERE spread > 0", "rawQuery": true, - "rawSql": "SELECT\n split_part(data->>'server_version'::text, ' ', 1) as server_version,\n (data->>'server_version_num')::int8 as server_version_num,\n string_agg(DISTINCT dbname, ', ') as dbname \nFROM\n settings\nWHERE\n $__timeFilter(time)\n AND dbname IN ($dbname)\n AND (data->>'server_version_num')::int8 <= $lower_than_server_version_num\nGROUP BY 1, 2\nORDER BY 1", + "rawSql": "SELECT\n (data->>'value')::int8 AS server_version_num,\n string_agg(DISTINCT sn.dbname, ', ') AS dbname\nFROM settings_num sn\nWHERE $__timeFilter(sn.time)\n AND sn.dbname IN ($dbname)\n AND sn.tag_data->>'name' = 'server_version_num'\n AND (sn.data->>'value')::int8 <= $lower_than_server_version_num\nGROUP BY 1\nORDER BY 1", "refId": "A", "resultFormat": "table", "select": [ @@ -202,7 +202,7 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "### Brought to you by\n\n[![Cybertec – The PostgreSQL Database Company](https://cdn.jsdelivr.net/gh/cybertec-postgresql/pgwatch@master/docs/gallery/cybertec-logo-white-blue.svg)](https://www.cybertec-postgresql.com/en/)\n", + "content": "### Brought to you by\n\n[![Cybertec \u2013 The PostgreSQL Database Company](https://cdn.jsdelivr.net/gh/cybertec-postgresql/pgwatch@master/docs/gallery/cybertec-logo-white-blue.svg)](https://www.cybertec-postgresql.com/en/)\n", "mode": "markdown" }, "pluginVersion": "12.0.0", @@ -230,12 +230,12 @@ "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, - "definition": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings' ORDER BY 1;", + "definition": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings_num' ORDER BY 1;", "includeAll": true, "multi": true, "name": "dbname", "options": [], - "query": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings' ORDER BY 1;", + "query": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings_num' ORDER BY 1;", "refresh": 1, "regex": "", "type": "query" @@ -245,11 +245,11 @@ "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, - "definition": "SELECT DISTINCT (data->>'server_version_num')::int FROM settings WHERE time > now() - '24h'::interval ORDER BY 1 DESC", + "definition": "SELECT DISTINCT (data->>'value')::int\nFROM settings_num\nWHERE tag_data->>'name' = 'server_version_num'\n AND time > now() - '24h'::interval\nORDER BY 1 DESC", "includeAll": false, "name": "lower_than_server_version_num", "options": [], - "query": "SELECT DISTINCT (data->>'server_version_num')::int FROM settings WHERE time > now() - '24h'::interval ORDER BY 1 DESC", + "query": "SELECT DISTINCT (data->>'value')::int\nFROM settings_num\nWHERE tag_data->>'name' = 'server_version_num'\n AND time > now() - '24h'::interval\nORDER BY 1 DESC", "refresh": 1, "regex": "", "type": "query" diff --git a/grafana/postgres/v12/recommendations.json b/grafana/postgres/v12/recommendations.json index 8ea0e19eac..68afbe639b 100644 --- a/grafana/postgres/v12/recommendations.json +++ b/grafana/postgres/v12/recommendations.json @@ -315,7 +315,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n dbname AS \"Source\",\n (select data->>'server_version' from settings s where s.dbname = x.dbname order by time desc limit 1) AS \"PostgreSQL Version\",\n 'AUTOVACUUM Workers' AS \"Category\",\n 'If most / all autovacuum worker slots are busy or AV runs for hours then this could hint at incorrect AV params or too much workload' AS \"Recommendation\",\n 'Max. active autovacuum workers: ' || max_av_workers || ' (of total ' || (select (data->>'autovacuum_max_workers')::int from settings s where s.dbname = x.dbname order by time desc limit 1) || '); Max. AV duration (seconds): ' || longest_autovacuum_seconds AS \"Additional Info\"\nFROM (\nSELECT\n dbname,\n max((data->>'av_workers')::int) as max_av_workers,\n coalesce(max((data->>'longest_autovacuum_seconds')::int), 0) as longest_autovacuum_seconds\nFROM\n backends\nWHERE\n $__timeFilter(time)\n AND dbname IN ($dbname)\nGROUP BY\n dbname\n) x\nWHERE\n (max_av_workers > 1 AND max_av_workers::numeric / (select (data->>'autovacuum_max_workers')::int from settings s where s.dbname = x.dbname order by time desc limit 1) >= 0.6)\n OR\n (longest_autovacuum_seconds > 1800)", + "rawSql": "SELECT\n dbname AS \"Source\",\n (SELECT (data->>'value')::int8::text FROM settings_num s WHERE s.dbname = x.dbname AND s.tag_data->>'name' = 'server_version_num' ORDER BY time DESC LIMIT 1) AS \"PostgreSQL Version\",\n 'AUTOVACUUM Workers' AS \"Category\",\n 'If most / all autovacuum worker slots are busy or AV runs for hours then this could hint at incorrect AV params or too much workload' AS \"Recommendation\",\n 'Max. active autovacuum workers: ' || max_av_workers || ' (of total ' || (SELECT (data->>'value')::int FROM settings_num s WHERE s.dbname = x.dbname AND s.tag_data->>'name' = 'autovacuum_max_workers' ORDER BY s.time DESC LIMIT 1) || '); Max. AV duration (seconds): ' || longest_autovacuum_seconds AS \"Additional Info\"\nFROM (\nSELECT\n dbname,\n max((data->>'av_workers')::int) as max_av_workers,\n coalesce(max((data->>'longest_autovacuum_seconds')::int), 0) as longest_autovacuum_seconds\nFROM\n backends\nWHERE\n $__timeFilter(time)\n AND dbname IN ($dbname)\nGROUP BY\n dbname\n) x\nWHERE\n (max_av_workers > 1 AND max_av_workers::numeric / (SELECT (data->>'value')::int FROM settings_num s WHERE s.dbname = x.dbname AND s.tag_data->>'name' = 'autovacuum_max_workers' ORDER BY s.time DESC LIMIT 1) >= 0.6)\n OR\n (longest_autovacuum_seconds > 1800)", "refId": "A", "select": [ [ @@ -587,7 +587,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n dbname AS \"Source\",\n (select data->>'server_version' from settings s where s.dbname = y.dbname order by s.time desc limit 1) AS \"PostgreSQL Version\",\n 'Global Server Settings' AS \"Category\",\n 'Increase checkpoint_timeout or max_wal_size for more infrequent checkpoints, thereby reducing total IO' AS \"Recommendation\",\n 'Avg. seconds between checkpoint requests: ' || avg_seconds_between_checkpoints_reqs::int8 AS \"Additional Info\"\nFROM (\nSELECT\n dbname,\n round((extract(epoch from max_time - min_time) / (max_req - min_req))::numeric, 1) as avg_seconds_between_checkpoints_reqs\nFROM (\n SELECT\n dbname,\n min(time) as min_time,\n max(time) as max_time,\n min((data->>'checkpoints_req')::int8) as min_req,\n max((data->>'checkpoints_req')::int8) as max_req\n FROM\n bgwriter\n WHERE\n $__timeFilter(time)\n AND dbname IN ($dbname)\nGROUP BY\n dbname\nHAVING\n max((data->>'checkpoints_req')::int8) > min((data->>'checkpoints_req')::int8)\n) x\n) y\nWHERE\n avg_seconds_between_checkpoints_reqs < (select extract(epoch from (data->>'checkpoint_timeout')::interval) / 2.0 from settings s where s.dbname = y.dbname order by s.time desc limit 1)\nORDER BY\n avg_seconds_between_checkpoints_reqs\nLIMIT\n 25", + "rawSql": "SELECT\n dbname AS \"Source\",\n (SELECT (data->>'value')::int8::text FROM settings_num s WHERE s.dbname = y.dbname AND s.tag_data->>'name' = 'server_version_num' ORDER BY s.time DESC LIMIT 1) AS \"PostgreSQL Version\",\n 'Global Server Settings' AS \"Category\",\n 'Increase checkpoint_timeout or max_wal_size for more infrequent checkpoints, thereby reducing total IO' AS \"Recommendation\",\n 'Avg. seconds between checkpoint requests: ' || avg_seconds_between_checkpoints_reqs::int8 AS \"Additional Info\"\nFROM (\nSELECT\n dbname,\n round((extract(epoch from max_time - min_time) / (max_req - min_req))::numeric, 1) as avg_seconds_between_checkpoints_reqs\nFROM (\n SELECT\n dbname,\n min(time) as min_time,\n max(time) as max_time,\n min((data->>'checkpoints_req')::int8) as min_req,\n max((data->>'checkpoints_req')::int8) as max_req\n FROM\n bgwriter\n WHERE\n $__timeFilter(time)\n AND dbname IN ($dbname)\nGROUP BY\n dbname\nHAVING\n max((data->>'checkpoints_req')::int8) > min((data->>'checkpoints_req')::int8)\n) x\n) y\nWHERE\n avg_seconds_between_checkpoints_reqs < (SELECT (data->>'value')::float8 / 2.0 FROM settings_num s WHERE s.dbname = y.dbname AND s.tag_data->>'name' = 'checkpoint_timeout' ORDER BY s.time DESC LIMIT 1)\nORDER BY\n avg_seconds_between_checkpoints_reqs\nLIMIT\n 25", "refId": "A", "select": [ [ @@ -656,7 +656,7 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "### Brought to you by\n\n[![Cybertec – The PostgreSQL Database Company](https://cdn.jsdelivr.net/gh/cybertec-postgresql/pgwatch@master/docs/gallery/cybertec-logo-white-blue.svg)](https://www.cybertec-postgresql.com/en/)\n", + "content": "### Brought to you by\n\n[![Cybertec \u2013 The PostgreSQL Database Company](https://cdn.jsdelivr.net/gh/cybertec-postgresql/pgwatch@master/docs/gallery/cybertec-logo-white-blue.svg)](https://www.cybertec-postgresql.com/en/)\n", "mode": "markdown" }, "pluginVersion": "12.1.0", diff --git a/grafana/postgres/v12/settings-overview.json b/grafana/postgres/v12/settings-overview.json new file mode 100644 index 0000000000..2786e3f5a6 --- /dev/null +++ b/grafana/postgres/v12/settings-overview.json @@ -0,0 +1,3582 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Overview of all numeric PostgreSQL settings using the settings_num metric. One row per setting per collection, setting name stored as tag. Replaces the legacy wide-column 'settings' metric that caused Prometheus label cardinality explosion.", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [], + "title": "Server & Connection", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "e.g. 160005 = PG 16.5", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 1 + }, + "hideTimeOverride": true, + "id": 2, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'server_version_num'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Server Version Num", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 1 + }, + "hideTimeOverride": true, + "id": 3, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_connections'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max Connections", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "In 8 kB blocks", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 1 + }, + "hideTimeOverride": true, + "id": 4, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'shared_buffers'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Shared Buffers", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "In kB per sort/hash op", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 1 + }, + "hideTimeOverride": true, + "id": 5, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'work_mem'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Work Mem", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "In kB (VACUUM, CREATE INDEX)", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 1 + }, + "hideTimeOverride": true, + "id": 6, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'maintenance_work_mem'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Maintenance Work Mem", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "In 8 kB blocks", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 1 + }, + "hideTimeOverride": true, + "id": 7, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'effective_cache_size'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Effective Cache Size", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 8, + "panels": [], + "title": "Safety / Reliability", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 6 + }, + "hideTimeOverride": true, + "id": 9, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'fsync'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "fsync", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 6 + }, + "hideTimeOverride": true, + "id": 10, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'full_page_writes'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Full Page Writes", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 6 + }, + "hideTimeOverride": true, + "id": 11, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'ssl'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "SSL", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 6 + }, + "hideTimeOverride": true, + "id": 12, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'data_checksums'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Data Checksums", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 6 + }, + "hideTimeOverride": true, + "id": 13, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'wal_compression'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "WAL Compression", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 6 + }, + "hideTimeOverride": true, + "id": 14, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'wal_log_hints'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "WAL Log Hints", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 15, + "panels": [], + "title": "Autovacuum", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 11 + }, + "hideTimeOverride": true, + "id": 16, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Autovacuum", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 11 + }, + "hideTimeOverride": true, + "id": 17, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum_max_workers'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "AV Max Workers", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 3, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 11 + }, + "hideTimeOverride": true, + "id": 18, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum_vacuum_scale_factor'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "AV Vacuum Scale Factor", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 11 + }, + "hideTimeOverride": true, + "id": 19, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum_vacuum_threshold'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "AV Vacuum Threshold", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 3, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 11 + }, + "hideTimeOverride": true, + "id": 20, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum_analyze_scale_factor'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "AV Analyze Scale Factor", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 11 + }, + "hideTimeOverride": true, + "id": 21, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'autovacuum_analyze_threshold'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "AV Analyze Threshold", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 22, + "panels": [], + "title": "Parallelism & Replication", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 16 + }, + "hideTimeOverride": true, + "id": 23, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_worker_processes'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max Worker Processes", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 16 + }, + "hideTimeOverride": true, + "id": 24, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_parallel_workers'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max Parallel Workers", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 16 + }, + "hideTimeOverride": true, + "id": 25, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_parallel_workers_per_gather'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max Parallel Workers / Gather", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 16 + }, + "hideTimeOverride": true, + "id": 26, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_wal_senders'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max WAL Senders", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 16 + }, + "hideTimeOverride": true, + "id": 27, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_replication_slots'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max Replication Slots", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 16 + }, + "hideTimeOverride": true, + "id": 28, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'hot_standby'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Hot Standby", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 29, + "panels": [], + "title": "WAL & Checkpoints", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "1=minimal 2=replica 3=logical", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "1": { + "index": 0, + "text": "minimal" + }, + "2": { + "index": 1, + "text": "replica" + }, + "3": { + "index": 2, + "text": "logical" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 21 + }, + "hideTimeOverride": true, + "id": 30, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'wal_level'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "WAL Level", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "1=off 2=on 3=always", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "1": { + "index": 0, + "text": "off" + }, + "2": { + "index": 1, + "text": "on" + }, + "3": { + "index": 2, + "text": "always" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 21 + }, + "hideTimeOverride": true, + "id": 31, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'archive_mode'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Archive Mode", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 21 + }, + "hideTimeOverride": true, + "id": 32, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'checkpoint_timeout'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Checkpoint Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 2, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 21 + }, + "hideTimeOverride": true, + "id": 33, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'checkpoint_completion_target'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Checkpoint Completion Target", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "In MB", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 21 + }, + "hideTimeOverride": true, + "id": 34, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'min_wal_size'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Min WAL Size", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "In MB", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 21 + }, + "hideTimeOverride": true, + "id": 35, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_wal_size'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max WAL Size", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 36, + "panels": [], + "title": "Timeouts & Locks", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 26 + }, + "hideTimeOverride": true, + "id": 37, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'statement_timeout'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Statement Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 26 + }, + "hideTimeOverride": true, + "id": 38, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'lock_timeout'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Lock Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 26 + }, + "hideTimeOverride": true, + "id": 39, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'deadlock_timeout'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Deadlock Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 26 + }, + "hideTimeOverride": true, + "id": 40, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'max_prepared_transactions'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Max Prepared Transactions", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#299c46", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 26 + }, + "hideTimeOverride": true, + "id": 41, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'jit'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "JIT", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "0 = log all; -1 = disabled", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 26 + }, + "hideTimeOverride": true, + "id": 42, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = 'log_autovacuum_min_duration'\n AND $__timeFilter(time)\nORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Log Autovacuum Min Duration", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 43, + "panels": [], + "title": "All Settings", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "All numeric settings from the latest snapshot. One row per setting.", + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 350 + }, + { + "id": "displayName", + "value": "Setting Name" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "value" + }, + "properties": [ + { + "id": "custom.width", + "value": 180 + }, + { + "id": "displayName", + "value": "Current Value" + } + ] + } + ] + }, + "gridPos": { + "h": 16, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 44, + "options": { + "cellHeight": "sm", + "footer": { + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Setting Name" + } + ] + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n tag_data->>'name' AS name,\n (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND time = (\n SELECT max(time) FROM settings_num\n WHERE dbname = '$dbname'\n AND $__timeFilter(time)\n )\nORDER BY name", + "refId": "A" + } + ], + "title": "All Settings (current snapshot)", + "type": "table" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 47 + }, + "id": 45, + "panels": [], + "title": "Changed Settings Detection", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "Settings that took more than one distinct numeric value within the selected time window.", + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 320 + }, + { + "id": "displayName", + "value": "Setting Name" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "distinct_values" + }, + "properties": [ + { + "id": "displayName", + "value": "# Distinct Values" + }, + { + "id": "custom.width", + "value": 140 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "min_value" + }, + "properties": [ + { + "id": "displayName", + "value": "Min Value" + }, + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "max_value" + }, + "properties": [ + { + "id": "displayName", + "value": "Max Value" + }, + { + "id": "custom.width", + "value": 120 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 48 + }, + "id": 46, + "options": { + "cellHeight": "sm", + "footer": { + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Setting Name" + } + ] + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "table", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n tag_data->>'name' AS name,\n count(DISTINCT (data->>'value')::float8) AS distinct_values,\n min((data->>'value')::float8) AS min_value,\n max((data->>'value')::float8) AS max_value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND $__timeFilter(time)\nGROUP BY 1\nHAVING count(DISTINCT (data->>'value')::float8) > 1\nORDER BY 1", + "refId": "A" + } + ], + "title": "Settings Changed in Time Range", + "transformations": [ + { + "id": "merge", + "options": {} + } + ], + "type": "table" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "description": "Value of the selected setting over time. Choose a setting from the $setting variable.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "drawStyle": "line", + "fillOpacity": 10, + "lineWidth": 2, + "spanNulls": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 48 + }, + "id": 47, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "format": "time_series", + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n time,\n (data->>'value')::float8 AS value\nFROM settings_num\nWHERE dbname = '$dbname'\n AND tag_data->>'name' = '$setting'\n AND $__timeFilter(time)\nORDER BY time", + "refId": "A", + "timeColumn": "time" + } + ], + "title": "Setting Value Over Time: $setting", + "type": "timeseries" + } + ], + "preload": false, + "refresh": "5m", + "schemaVersion": 41, + "tags": [ + "pgwatch" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "definition": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings_num' ORDER BY 1", + "includeAll": false, + "multi": false, + "name": "dbname", + "options": [], + "query": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings_num' ORDER BY 1", + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "pgwatch-metrics" + }, + "definition": "SELECT DISTINCT tag_data->>'name' FROM settings_num WHERE dbname = '$dbname' AND time > now() - '24h'::interval ORDER BY 1", + "label": "Setting", + "includeAll": false, + "multi": false, + "name": "setting", + "options": [], + "query": "SELECT DISTINCT tag_data->>'name' FROM settings_num WHERE dbname = '$dbname' AND time > now() - '24h'::interval ORDER BY 1", + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Settings Overview", + "uid": "settings-num-postgres", + "version": 1 +} \ No newline at end of file diff --git a/grafana/prometheus/v12/0-health-check-prometheus.json b/grafana/prometheus/v12/0-health-check-prometheus.json index 920e9e04dd..2d3871313c 100644 --- a/grafana/prometheus/v12/0-health-check-prometheus.json +++ b/grafana/prometheus/v12/0-health-check-prometheus.json @@ -252,7 +252,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "max_over_time(pgwatch_settings_server_version_num{dbname='$dbname'}[$__interval])", + "expr": "max_over_time(pgwatch_settings_num_value{name=\"server_version_num\",dbname=\"$dbname\"}[$__interval])", "instant": true, "interval": "", "legendFormat": "", @@ -471,7 +471,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "100.0 * max(max_over_time(pgwatch_db_stats_numbackends{dbname='$dbname'}[$__interval])) / max(max_over_time(pgwatch_settings_max_connections{dbname='$dbname'}[$__interval]))", + "expr": "100.0 * max(max_over_time(pgwatch_db_stats_numbackends{dbname=\"$dbname\"}[$__interval])) / max(max_over_time(pgwatch_settings_num_value{name=\"max_connections\",dbname=\"$dbname\"}[$__interval]))", "instant": true, "interval": "", "legendFormat": "", diff --git a/grafana/prometheus/v12/settings-overview-prometheus.json b/grafana/prometheus/v12/settings-overview-prometheus.json new file mode 100644 index 0000000000..3feec75859 --- /dev/null +++ b/grafana/prometheus/v12/settings-overview-prometheus.json @@ -0,0 +1,3253 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Overview of all numeric PostgreSQL settings using the settings_num metric. Each setting is a separate time series with the setting name as a label, eliminating the cardinality explosion of the legacy 'settings' metric.", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [], + "title": "Server & Connection", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Integer encoding of PG version, e.g. 160005 = 16.5", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-yellow" + }, + { + "color": "dark-green", + "value": 120000 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 2, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"server_version_num\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Server Version Num", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 3, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_connections\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Connections", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "In 8 kB blocks. 1 block = 8 KB.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 1 + }, + "id": 4, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"shared_buffers\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Shared Buffers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "In kB. Per sort / hash operation.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 1 + }, + "id": 5, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"work_mem\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Work Mem", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "In kB. Used by VACUUM, CREATE INDEX, etc.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 1 + }, + "id": 6, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"maintenance_work_mem\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Maintenance Work Mem", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "In 8 kB blocks. Planner estimate of OS + PG cache.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 1 + }, + "id": 7, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"effective_cache_size\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Effective Cache Size", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 8, + "panels": [], + "title": "Safety / Reliability", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 6 + }, + "id": 9, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"fsync\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "fsync", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 6 + }, + "id": 10, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"full_page_writes\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Full Page Writes", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 6 + }, + "id": 11, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"ssl\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "SSL", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 6 + }, + "id": 12, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"data_checksums\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Data Checksums", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 6 + }, + "id": 13, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"wal_compression\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "WAL Compression", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 6 + }, + "id": 14, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"wal_log_hints\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "WAL Log Hints", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 15, + "panels": [], + "title": "Autovacuum", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 11 + }, + "id": 16, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"autovacuum\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Autovacuum", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 11 + }, + "id": 17, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"autovacuum_max_workers\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "AV Max Workers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Fraction of table size triggering VACUUM", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 11 + }, + "id": 18, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"autovacuum_vacuum_scale_factor\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "AV Vacuum Scale Factor", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Min dead tuples before VACUUM", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 11 + }, + "id": 19, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"autovacuum_vacuum_threshold\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "AV Vacuum Threshold", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Fraction of table size triggering ANALYZE", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 11 + }, + "id": 20, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"autovacuum_analyze_scale_factor\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "AV Analyze Scale Factor", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Min changed rows before ANALYZE", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 11 + }, + "id": 21, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"autovacuum_analyze_threshold\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "AV Analyze Threshold", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 22, + "panels": [], + "title": "Parallelism & Replication", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 16 + }, + "id": 23, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_worker_processes\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Worker Processes", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 16 + }, + "id": 24, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_parallel_workers\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Parallel Workers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 16 + }, + "id": 25, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_parallel_workers_per_gather\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Parallel Workers / Gather", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 16 + }, + "id": 26, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_wal_senders\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max WAL Senders", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 16 + }, + "id": 27, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_replication_slots\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Replication Slots", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 16 + }, + "id": 28, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"hot_standby\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Hot Standby", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 29, + "panels": [], + "title": "WAL & Checkpoints", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "1=minimal 2=replica 3=logical", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "1": { + "index": 0, + "text": "minimal" + }, + "2": { + "index": 1, + "text": "replica" + }, + "3": { + "index": 2, + "text": "logical" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 21 + }, + "id": 30, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"wal_level\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "WAL Level", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "1=off 2=on 3=always", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "1": { + "index": 0, + "text": "off" + }, + "2": { + "index": 1, + "text": "on" + }, + "3": { + "index": 2, + "text": "always" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 21 + }, + "id": 31, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"archive_mode\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Archive Mode", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Max time between automatic checkpoints (seconds)", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 21 + }, + "id": 32, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"checkpoint_timeout\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Checkpoint Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Fraction of checkpoint_timeout to spread I/O over", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 21 + }, + "id": 33, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"checkpoint_completion_target\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Checkpoint Completion Target", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "In MB", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 21 + }, + "id": 34, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"min_wal_size\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Min WAL Size", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "In MB", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 21 + }, + "id": 35, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_wal_size\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max WAL Size", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 36, + "panels": [], + "title": "Timeouts & Locks", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "0 = disabled", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 26 + }, + "id": 37, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"statement_timeout\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Statement Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "0 = disabled", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 26 + }, + "id": 38, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"lock_timeout\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Lock Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 26 + }, + "id": 39, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"deadlock_timeout\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Deadlock Timeout", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 26 + }, + "id": 40, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"max_prepared_transactions\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Max Prepared Transactions", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-red", + "index": 0, + "text": "off" + } + }, + "type": "value" + }, + { + "options": { + "1": { + "color": "dark-green", + "index": 1, + "text": "on" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-green", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 26 + }, + "id": 41, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"jit\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "JIT", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "0 = log all autovacuums; -1 = disabled", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 26 + }, + "id": 42, + "interval": "3h", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max_over_time(pgwatch_settings_num_value{name=\"log_autovacuum_min_duration\",dbname=\"$dbname\"}[$__interval])", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Log Autovacuum Min Duration", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 43, + "panels": [], + "title": "All Settings", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "All numeric PostgreSQL settings collected by settings_num. Each row is one setting; name is a Prometheus label.", + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 350 + }, + { + "id": "displayName", + "value": "Setting Name" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "custom.width", + "value": 150 + }, + { + "id": "displayName", + "value": "Current Value" + } + ] + } + ] + }, + "gridPos": { + "h": 16, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 44, + "options": { + "cellHeight": "sm", + "footer": { + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Setting Name" + } + ] + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "expr": "pgwatch_settings_num_value{dbname=\"$dbname\"}", + "format": "table", + "instant": true, + "interval": "3h", + "legendFormat": "__auto", + "refId": "A" + } + ], + "title": "All Settings (current snapshot)", + "transformations": [ + { + "id": "labelsToFields", + "options": { + "mode": "columns", + "valueLabel": "name" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "dbname": true, + "instance": true, + "job": true + }, + "indexByName": {}, + "renameByName": {} + } + } + ], + "type": "table" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 47 + }, + "id": 45, + "panels": [], + "title": "Changed Settings Detection", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "Settings whose value changed at least once in the selected time range. Uses Prometheus changes() function.", + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "displayName", + "value": "Setting Name" + }, + { + "id": "custom.width", + "value": 350 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "displayName", + "value": "# Changes in range" + }, + { + "id": "custom.width", + "value": 150 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 48 + }, + "id": 46, + "options": { + "cellHeight": "sm", + "footer": { + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "# Changes in range" + } + ] + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "expr": "changes(pgwatch_settings_num_value{dbname=\"$dbname\"}[$__range]) > 0", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "refId": "A" + } + ], + "title": "Settings Changed in Time Range", + "transformations": [ + { + "id": "labelsToFields", + "options": { + "mode": "columns", + "valueLabel": "name" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "dbname": true, + "instance": true, + "job": true + }, + "indexByName": {} + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "description": "History of a single setting value over time. Use the $setting variable to select which setting to inspect.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "lineWidth": 2, + "fillOpacity": 10, + "drawStyle": "line", + "spanNulls": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 48 + }, + "id": 47, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "editorMode": "code", + "expr": "pgwatch_settings_num_value{name=\"$setting\",dbname=\"$dbname\"}", + "instant": false, + "interval": "", + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "Setting Value Over Time: $setting", + "type": "timeseries" + } + ], + "preload": false, + "refresh": "5m", + "schemaVersion": 41, + "tags": [ + "pgwatch" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "definition": "label_values(pgwatch_settings_num_value, dbname)", + "includeAll": false, + "multi": false, + "name": "dbname", + "options": [], + "query": { + "query": "label_values(pgwatch_settings_num_value, dbname)", + "refId": "A" + }, + "refresh": 2, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "pgwatch-prometheus" + }, + "definition": "label_values(pgwatch_settings_num_value{dbname=\"$dbname\"}, name)", + "includeAll": false, + "multi": false, + "name": "setting", + "label": "Setting", + "options": [], + "query": { + "query": "label_values(pgwatch_settings_num_value{dbname=\"$dbname\"}, name)", + "refId": "A" + }, + "refresh": 2, + "regex": "", + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Settings Overview", + "uid": "settings-num-prometheus", + "version": 1 +} \ No newline at end of file diff --git a/internal/metrics/metrics.yaml b/internal/metrics/metrics.yaml index 78bfe084b9..333f1b45ba 100644 --- a/internal/metrics/metrics.yaml +++ b/internal/metrics/metrics.yaml @@ -1886,9 +1886,9 @@ metrics: */ settings: description: > - This metric collects various PostgreSQL server settings and configurations. - It provides insights into the server's configuration, including version, memory settings, and other important parameters. - This metric is useful for monitoring server settings and ensuring optimal performance. + DEPRECATED: use 'settings_num' instead. This metric returns most configuration values as text columns, + which causes Prometheus label cardinality explosion (each config change creates a new time series). + Kept for backward compatibility only — it is no longer included in any built-in preset. sqls: 14: | with qs as ( @@ -1945,6 +1945,32 @@ metrics: (select setting::float8 from qs where name = 'autovacuum_vacuum_threshold') as autovacuum_vacuum_threshold, (select setting::float8 from qs where name = 'autovacuum_analyze_scale_factor') as autovacuum_analyze_scale_factor, (select setting::float8 from qs where name = 'autovacuum_analyze_threshold') as autovacuum_analyze_scale_factor + settings_num: + description: > + Exports all PostgreSQL settings (including extension and user-defined parameters) as numeric values, + one row per setting. Boolean settings are converted to 1/0, integer and real settings are cast to + float8, and enum settings are represented as the 1-based ordinal position of the current value + within the setting's list of valid values (enumvals). The setting name is exposed as a tag so each + parameter becomes its own Prometheus time series, avoiding the cardinality explosion caused by the + legacy 'settings' metric which returned all values as labels. + sqls: + 11: | + select /* pgwatch_generated */ + (extract(epoch from now()) * 1e9)::int8 as epoch_ns, + name as tag_name, + case vartype + when 'integer' then setting::float8 + when 'real' then setting::float8 + when 'bool' then (case setting when 'on' then 1 else 0 end)::float8 + when 'enum' then array_position(enumvals, setting)::float8 + end as value + from pg_settings + where vartype in ('integer', 'real', 'bool', 'enum') + and setting is not null + order by name + gauges: + - value + is_instance_level: true smart_health_per_disk: description: > This metric collects SMART health status for all disk devices using the `smartmontools` utility. @@ -4211,7 +4237,7 @@ presets: replication: 120 replication_slots: 120 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_activity: 60 stat_statements: 180 @@ -4238,7 +4264,7 @@ presets: replication: 120 replication_slots: 120 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_activity: 30 stat_statements: 180 @@ -4263,7 +4289,7 @@ presets: replication: 60 replication_slots: 60 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_ssl: 60 stat_statements: 180 @@ -4301,7 +4327,7 @@ presets: replication: 120 replication_slots: 120 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_activity: 30 stat_statements: 180 @@ -4348,7 +4374,7 @@ presets: replication_slots: 120 sequence_health: 3600 server_log_event_counts: 60 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_activity: 30 stat_ssl: 120 @@ -4376,7 +4402,7 @@ presets: replication: 120 replication_slots: 120 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_statements: 180 stat_statements_calls: 60 @@ -4428,7 +4454,7 @@ presets: replication: 120 replication_slots: 120 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_activity: 30 stat_statements: 180 @@ -4471,7 +4497,7 @@ presets: replication: 120 replication_slots: 120 sequence_health: 3600 - settings: 7200 + settings_num: 7200 sproc_stats: 180 stat_activity: 30 stat_statements: 180 @@ -4530,7 +4556,7 @@ presets: replication_slots: 30 sequence_health: 30 server_log_event_counts: 30 - settings: 30 + settings_num: 30 smart_health_per_disk: 30 sproc_hashes: 30 sproc_stats: 30