{ "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "description": "", "editable": true, "gnetId": null, "graphTooltip": 0, "id": 668, "iteration": 1634906364784, "links": [], "panels": [ { "collapsed": false, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 233, "panels": [], "title": "Quick Stats", "type": "row" }, { "datasource": "InfluxDB", "description": "This shows the *current* open connections on the selected server.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 50 } ] } }, "overrides": [] }, "gridPos": { "h": 7, "w": 4, "x": 0, "y": 1 }, "id": 224, "interval": "5m", "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "auto" }, "pluginVersion": "8.1.5", "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_connections", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "idle" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "IDLE" ], "type": "alias" } ], [ { "params": [ "idle_tx" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "IDLE in TX" ], "type": "alias" } ], [ { "params": [ "waiting" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Waiting" ], "type": "alias" } ], [ { "params": [ "query_running" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Active" ], "type": "alias" } ], [ { "params": [ "unknown" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Unknown" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" } ] } ], "timeFrom": null, "title": "Current Connections", "transformations": [ { "id": "calculateField", "options": { "mode": "reduceRow", "reduce": { "include": [ "IDLE", "IDLE in TX", "Waiting", "Active", "Unknown" ], "reducer": "sum" }, "replaceFields": true } } ], "type": "stat" }, { "datasource": "InfluxDB", "description": "Overall number of locks present in the database", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 7, "w": 4, "x": 4, "y": 1 }, "id": 230, "interval": "5m", "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "auto" }, "pluginVersion": "8.1.5", "targets": [ { "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_locks", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "count" ], "type": "field" }, { "params": [], "type": "last" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "database", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Locks", "type": "stat" }, { "datasource": "InfluxDB", "description": "This graph combines all tuple access (inserts, updates and deletes) giving an overall activity indicator on the database", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "log": 10, "type": "log" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 7, "w": 16, "x": 8, "y": 1 }, "id": 226, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "pluginVersion": "8.0.2", "targets": [ { "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_row_access", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "n_tup_del" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" } ], [ { "params": [ "n_tup_hot_upd" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" } ], [ { "params": [ "n_tup_ins" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" } ], [ { "params": [ "n_tup_upd" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "dbname", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Overall Tuple Access", "transformations": [ { "id": "calculateField", "options": { "mode": "reduceRow", "reduce": { "include": [ "postgres_row_access.non_negative_difference", "postgres_row_access.non_negative_difference_1", "postgres_row_access.non_negative_difference_3", "postgres_row_access.non_negative_difference_2" ], "reducer": "mean" }, "replaceFields": true } } ], "type": "timeseries" }, { "collapsed": true, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 8 }, "id": 54, "panels": [ { "datasource": "InfluxDB", "description": "This graph shows any running queries at the time of measurement and their respective ages.\n\n* `Age`: The time in seconds oldest query has been actively running.\n* `Transaction Age`: The time in seconds the oldest transaction has been existing.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 9 }, "id": 158, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_query_ages", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "query_age_s" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Age" ], "type": "alias" } ], [ { "params": [ "transaction_age_s" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Transaction Age" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "database", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Query Ages", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "This graph shows the number of transactions and their finishing states. Either committed or rolled back.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "Transactions", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 9 }, "id": 231, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_transactions", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "commit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Committed" ], "type": "alias" } ], [ { "params": [ "rollback" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Rolled Back" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "database", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Transactions", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "This graph shows the number of locks currently in place in the DB cluster (per DB and per type).\n\nIf the lock is granted, it is listed as \"True\". If a process has requested the lock but it wasn't free yet, it if listed as \"False\".\n\n# Lock Types\n\n* `accesssharelock`: The SELECT command acquires a lock of this mode on referenced tables. In general, any query that only reads a table and does not modify it will acquire this lock mode.\n* `rowsharelock`: The SELECT FOR UPDATE and SELECT FOR SHARE commands acquire a lock of this mode on the target table(s) (in addition to ACCESS SHARE locks on any other tables that are referenced but not selected FOR UPDATE/FOR SHARE).\n* `rowexclusivelock`: The commands UPDATE, DELETE, and INSERT acquire this lock mode on the target table (in addition to ACCESS SHARE locks on any other referenced tables). In general, this lock mode will be acquired by any command that modifies data in a table.\n* `shareupdateexclusivelock`: Acquired by VACUUM (without FULL), ANALYZE, CREATE INDEX CONCURRENTLY, and some forms of ALTER TABLE.\n* `sharelock`: Acquired by CREATE INDEX (without CONCURRENTLY)\n* `sharerowexclusivelock`: This lock mode is not automatically acquired by any PostgreSQL command.\"\n* `exclusivelock`: This lock mode is not automatically acquired on tables by any PostgreSQL command.\n* `accessexclusivelock`: Acquired by the ALTER TABLE, DROP TABLE, TRUNCATE, REINDEX, CLUSTER, and VACUUM FULL commands. This is also the default lock mode for LOCK TABLE statements that do not specify a mode explicitly.\n", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 16 }, "id": 228, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$tag_mode", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "mode" ], "type": "tag" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_locks", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "count" ], "type": "field" }, { "params": [], "type": "mean" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "database", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Locks", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "This graph shows the different scan types executed on the database.\n\n* `Index Scan`: Whenever a query taps into an index\n* `Sequential Scan`: Whenever a query cannot use an index and decides to sequentially go through the table data", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 16 }, "id": 210, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_scan_types", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "idx_scan" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Index Scans" ], "type": "alias" } ], [ { "params": [ "seq_scan" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Sequential Scans" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "dbname", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Scan Types", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "This graph shows the number of rows/tuples modified in the main table-data.\n\n* `Deleted`: The number of deleted rows\n* `Updated`: The number of deleted rows\n* `Inserted`: The number of inserted rows\n* `HOT Updated`: The number of updated rows which did not require an index update", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "rows", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 23 }, "id": 160, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_row_access", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"n_tup_del\") AS \"Deleted Tuples\" FROM \"postgres_row_access\" WHERE (\"host\" =~ /^$host$/ AND \"dbname\" =~ /^$database$/) AND $timeFilter GROUP BY time($__interval) fill(null)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "n_tup_del" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Deleted" ], "type": "alias" } ], [ { "params": [ "n_tup_hot_upd" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "HOT Updated" ], "type": "alias" } ], [ { "params": [ "n_tup_ins" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Inserted" ], "type": "alias" } ], [ { "params": [ "n_tup_upd" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Updated" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "dbname", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Row Access", "type": "timeseries" } ], "title": "Activity: ${database} on host ${host}", "type": "row" }, { "collapsed": true, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 9 }, "id": 235, "panels": [ { "datasource": "InfluxDB", "description": "This graph shows the number of transactions and their finishing states. Either committed or rolled back.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "Transactions", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 10 }, "id": 222, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "repeat": "database", "repeatDirection": "v", "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_transactions", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "commit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Committed" ], "type": "alias" } ], [ { "params": [ "rollback" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Rolled Back" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "database", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Transactions for $database", "type": "timeseries" } ], "title": "Transactions per Database", "type": "row" }, { "collapsed": true, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 10 }, "id": 218, "panels": [ { "datasource": "InfluxDB", "description": "# Description\n\nThis graph shows a breakdown of disk-usage for the selected database(s). The breakdown shows the following fields:\n\n* `Data`: The disk usage by the main data of the tables.\n* `Visibility Map`: Size of metadata used by the VACUUM process.\n* `Free Space Map`: The Free Space map contains metadata where unused/reclaimable pages are located on disk.\n* `TOAST`: Space used by data which is larger than one \"page\".\n* `Indices`: Size of all indices\n* `Total Size`: Size of the DB folder on disk. If this is larger than the combined breakdown, it may indicate additional files on disk which don't belong in the DB.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "Size (bytes)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 44, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Total Size" }, "properties": [ { "id": "custom.stacking", "value": { "group": "A", "mode": "none" } }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.drawStyle", "value": "line" }, { "id": "color", "value": { "fixedColor": "rgba(255, 255, 255, 1)", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 9 }, "id": 216, "interval": "5m", "maxDataPoints": null, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_size_by_db", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"main_size\") AS \"Main\", mean(\"vm_size\") AS \"Visibility Map\", mean(\"fsm_size\") AS \"Free Space Map\", mean(\"toast_size\") AS \"TOAST\", mean(\"indexes_size\") AS \"Indices\" FROM \"postgres_size_by_db\" WHERE (\"host\" =~ /^$host$/ AND \"dbname\" =~ /^$database$/) AND $timeFilter GROUP BY time($__interval) fill(null)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "main_size" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Data" ], "type": "alias" } ], [ { "params": [ "vm_size" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Visibility Map" ], "type": "alias" } ], [ { "params": [ "fsm_size" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Free Space Map" ], "type": "alias" } ], [ { "params": [ "toast_size" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "TOAST" ], "type": "alias" } ], [ { "params": [ "indexes_size" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Indices" ], "type": "alias" } ], [ { "params": [ "database_size" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Total Size" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "dbname", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Database Size", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "This graph shows the disk-usage occupied by temporary files.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "Used Disk Space", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 9 }, "id": 220, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_temp_bytes", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "temp_bytes" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Temporary Bytes" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "database", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Temporary Bytes", "type": "timeseries" } ], "title": "Disk Usage: ${database} on ${host}", "type": "row" }, { "collapsed": true, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 11 }, "id": 214, "panels": [ { "datasource": "InfluxDB", "description": "# Description\n\nThis graph shows I/O operations on database indices.\n\n\"hit\" values are direct PostgreSQL buffer hits. \"Read\" values go out to OS kernel for physical disk reads. Note that physical disk reads can still be cached by the kernel and not require physical reads. But whether this happens or not is invisible to the PostgreSQL process.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 10 }, "id": 156, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_index_io", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "idx_blks_hit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Blocks Hit" ], "type": "alias" } ], [ { "params": [ "idx_blks_read" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Blocks Read" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "dbname", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Index I/O", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "# Description\n\nThis graph shows I/O operations on the disk for user-space tables.\n\n\"hit\" values are direct PostgreSQL buffer hits. \"Read\" values go out to OS kernel for physical disk reads. Note that physical disk reads can still be cached by the kernel and not require physical reads. But whether this happens or not is invisible to the PostgreSQL process.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 10 }, "id": 104, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_disk_io", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "heap_blks_hit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Heap Blocks Hit" ], "type": "alias" } ], [ { "params": [ "heap_blks_read" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Heap Blocks Read" ], "type": "alias" } ], [ { "params": [ "idx_blks_hit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Index Blocks Hit" ], "type": "alias" } ], [ { "params": [ "idx_blks_read" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Index Blocks Read" ], "type": "alias" } ], [ { "params": [ "tidx_blks_read" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "TOAST Index Blocks Read" ], "type": "alias" } ], [ { "params": [ "tidx_blks_hit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "TOAST Index Blocks Hit" ], "type": "alias" } ], [ { "params": [ "toast_blks_hit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "TOAST Blocks Hit" ], "type": "alias" } ], [ { "params": [ "toast_blks_read" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "TOAST Blocks Read" ], "type": "alias" } ] ], "tags": [ { "key": "dbname", "operator": "=~", "value": "/^$database$/" }, { "condition": "AND", "key": "host", "operator": "=~", "value": "/^$host$/" } ] } ], "timeFrom": null, "title": "Disk I/O", "type": "timeseries" }, { "datasource": "InfluxDB", "description": "# Description\n\nThis graph shows I/O operations on database sequences.\n\n\"hit\" values are direct PostgreSQL buffer hits. \"Read\" values go out to OS kernel for physical disk reads. Note that physical disk reads can still be cached by the kernel and not require physical reads. But whether this happens or not is invisible to the PostgreSQL process.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 18 }, "id": 212, "interval": "5m", "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ { "alias": "$col", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_sequences_io", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "blks_hit" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Hit" ], "type": "alias" } ], [ { "params": [ "blks_read" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [], "type": "non_negative_difference" }, { "params": [ "Read" ], "type": "alias" } ] ], "tags": [ { "key": "host", "operator": "=~", "value": "/^$host$/" }, { "condition": "AND", "key": "dbname", "operator": "=~", "value": "/^$database$/" } ] } ], "timeFrom": null, "title": "Sequences I/O", "type": "timeseries" } ], "title": "I/O: ${database} on host ${host}", "type": "row" }, { "collapsed": true, "datasource": null, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 12 }, "id": 4, "panels": [ { "datasource": "InfluxDB", "description": "# Description\n\nShows an overview of connections and their type on the PostgreSQL cluster.\n\n# Fields\n\n* `Waiting for Lock`: Connections which are waiting for a lock to be released\n* `Active`: Connections with running queries.\n* `IDLE`: Connections which are currently not doing anything.\n* `IDLE in TX` Connections which are not doing anything, but have an unfinished (neither committed nor rolled back) transaction open.\n* `Unknown`: Connections where the user fetching the stats did not have the access rights to get more details.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 13, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 0, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 14, "w": 24, "x": 0, "y": 13 }, "id": 2, "interval": "5m", "options": { "legend": { "calcs": [ "mean" ], "displayMode": "table", "placement": "right" }, "tooltip": { "mode": "multi" } }, "repeat": null, "targets": [ { "alias": "$tag_username ($col)", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "username" ], "type": "tag" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "postgres_connections", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "idle" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "IDLE" ], "type": "alias" } ], [ { "params": [ "idle_tx" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "IDLE in TX" ], "type": "alias" } ], [ { "params": [ "query_running" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Active" ], "type": "alias" } ], [ { "params": [ "waiting" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Waiting for lock" ], "type": "alias" } ], [ { "params": [ "unknown" ], "type": "field" }, { "params": [], "type": "mean" }, { "params": [ "Unknown" ], "type": "alias" } ] ], "tags": [ { "key": "username", "operator": "=~", "value": "/^$username$/" }, { "condition": "AND", "key": "host", "operator": "=~", "value": "/^$host$/" } ] } ], "timeFrom": null, "title": "Connections for user ${username}", "type": "timeseries" } ], "title": "Connections", "type": "row" } ], "refresh": "10s", "schemaVersion": 30, "style": "dark", "tags": [ "o:malbert" ], "templating": { "list": [ { "allValue": null, "current": { "selected": true, "text": [ "All" ], "value": [ "$__all" ] }, "datasource": "InfluxDB", "definition": "SHOW TAG VALUES WITH KEY = dbname", "description": null, "error": null, "hide": 0, "includeAll": true, "label": null, "multi": true, "name": "database", "options": [], "query": "SHOW TAG VALUES WITH KEY = dbname", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "allValue": null, "current": { "selected": true, "text": [ "All" ], "value": [ "$__all" ] }, "datasource": "InfluxDB", "definition": "SHOW TAG VALUES WITH KEY = username", "description": null, "error": null, "hide": 0, "includeAll": true, "label": null, "multi": true, "name": "username", "options": [], "query": "SHOW TAG VALUES WITH KEY = username", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "allValue": null, "current": { "selected": true, "text": [ "All" ], "value": [ "$__all" ] }, "datasource": "InfluxDB", "definition": "SHOW TAG VALUES WITH KEY = host", "description": null, "error": null, "hide": 0, "includeAll": true, "label": null, "multi": true, "name": "host", "options": [], "query": "SHOW TAG VALUES WITH KEY = host", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "PostgreSQL Metrics", "uid": "oG8lqdv7k", "version": 4 }