Files
grafana-dashboards/postgresexporter.json

2815 lines
70 KiB
JSON
Raw Normal View History

2025-08-13 17:09:45 +03:00
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
2025-09-17 15:23:54 +03:00
"id": 49,
2025-08-13 17:09:45 +03:00
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 4,
"panels": [],
"title": "Global",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Statements executed per Minute.\n\nSource: pg_stat_statements.calls",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "rgb(31, 120, 193)",
"mode": "fixed"
},
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 5,
"x": 0,
"y": 1
},
"id": 3,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_statements_calls_total{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "",
"range": true,
"refId": "A"
}
],
"title": "Query rate",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Setting: shared_buffers in PostgreSQL.conf",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
2025-09-15 16:33:45 +03:00
},
"unit": "bytes"
2025-08-13 17:09:45 +03:00
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 5,
"y": 1
},
"id": 6,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
2025-09-15 16:33:45 +03:00
"calcs": [],
"fields": "",
2025-08-13 17:09:45 +03:00
"values": false
},
"showPercentChange": false,
2025-09-15 16:33:45 +03:00
"text": {},
2025-08-13 17:09:45 +03:00
"textMode": "auto",
"wideLayout": true
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "pg_settings_shared_buffers_bytes{instance=\"$Instance\"}",
2025-09-15 16:33:45 +03:00
"legendFormat": "{{pod}}",
2025-08-13 17:09:45 +03:00
"range": true,
"refId": "A"
}
],
"title": "Shared Buffers",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Shared buffer hits vs reads from disc",
"fieldConfig": {
"defaults": {
"decimals": 2,
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "semi-dark-red",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "semi-dark-yellow",
"value": 80
},
{
"color": "semi-dark-green",
"value": 90
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 9,
"y": 1
},
"id": 7,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum(pg_stat_database_blks_hit{instance=~\"$Instance\"})/(sum(pg_stat_database_blks_hit{instance=~\"$Instance\"})+sum(pg_stat_database_blks_read{instance=~\"$Instance\"}))*100",
"refId": "A"
}
],
"title": "Shared Buffer Hits",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Percentage of max_connections used",
"fieldConfig": {
"defaults": {
"decimals": 0,
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"max": 1,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "semi-dark-green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "semi-dark-yellow",
"value": 0.75
},
{
"color": "semi-dark-red",
"value": 0.9
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 14,
"y": 1
},
"id": 8,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum(pg_stat_database_numbackends)/max(pg_settings_max_connections)",
"refId": "A"
}
],
"title": "Connections used",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Transaction committed vs rollbacked",
"fieldConfig": {
"defaults": {
"decimals": 2,
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"max": 1,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "semi-dark-red",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "#EAB839",
"value": 0.75
},
{
"color": "semi-dark-green",
"value": 0.9
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 19,
"y": 1
},
"id": 9,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum(pg_stat_database_xact_commit{instance=\"$Instance\"})/(sum(pg_stat_database_xact_commit{instance=\"$Instance\"}) + sum(pg_stat_database_xact_rollback{instance=\"$Instance\"}))",
"refId": "A"
}
],
"title": "Commit Ratio",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Transactions committed + roolback per minute\n\nSource: pg_stat_database,xact_commit + xact_rollback",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "rgb(31, 120, 193)",
"mode": "fixed"
},
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 5,
"x": 0,
"y": 5
},
"id": 1,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_database_xact_commit{instance=\"$Instance\"}[$__interval_ms])))+sum((rate(pg_stat_database_xact_rollback{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "",
"range": true,
"refId": "A"
}
],
"title": "Transaction rate",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Max Replication lag behind master in seconds\n\nOnly available on a standby system.\n\nSource: pg_last_xact_replay_timestamp\n\nUse: pg_stat_replication for Details.",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "rgb(31, 120, 193)",
"mode": "fixed"
},
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 5,
"y": 5
},
"id": 11,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"max"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "max(pg_replication_lag_seconds{instance=\"$Instance\"})",
"interval": "",
"legendFormat": "",
"range": true,
"refId": "A"
}
],
"title": "Max Replication Lag",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
2025-09-15 16:33:45 +03:00
"w": 19,
"x": 0,
2025-08-13 17:09:45 +03:00
"y": 9
},
"id": 21,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"editorMode": "code",
"expr": "pg_stat_database_numbackends{datname=~\"$Database\", instance=~\"$Instance\"}",
"legendFormat": "{{datname}}",
"range": true,
"refId": "A"
}
],
"title": "Connections to bases",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"description": "Size of all databases in $Instance.\n\nSource: pg_database_size()",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "rgb(31, 120, 193)",
"mode": "fixed"
},
"decimals": 2,
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 5,
"x": 19,
"y": 9
},
"id": 5,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum(pg_database_size_bytes{instance=\"$Instance\"})",
"range": true,
"refId": "A"
}
],
"title": "Total database size",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "View: pg_stat_activity\n",
2025-08-13 17:09:45 +03:00
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
2025-09-15 16:33:45 +03:00
"fillOpacity": 80,
2025-08-13 17:09:45 +03:00
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1,
"scaleDistribution": {
"type": "linear"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
2025-09-15 16:33:45 +03:00
"overrides": []
2025-08-13 17:09:45 +03:00
},
"gridPos": {
2025-09-15 16:33:45 +03:00
"h": 7,
2025-08-13 17:09:45 +03:00
"w": 19,
"x": 0,
"y": 16
},
2025-09-15 16:33:45 +03:00
"id": 38,
2025-08-13 17:09:45 +03:00
"options": {
2025-09-15 16:33:45 +03:00
"barRadius": 0,
"barWidth": 0.97,
"fullHighlight": false,
"groupWidth": 0.7,
2025-08-13 17:09:45 +03:00
"legend": {
2025-09-15 16:33:45 +03:00
"calcs": [],
"displayMode": "list",
2025-08-13 17:09:45 +03:00
"placement": "bottom",
"showLegend": true
},
2025-09-15 16:33:45 +03:00
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
2025-08-13 17:09:45 +03:00
"tooltip": {
"hideZeros": false,
2025-09-15 16:33:45 +03:00
"mode": "single",
2025-08-13 17:09:45 +03:00
"sort": "none"
2025-09-15 16:33:45 +03:00
},
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0
2025-08-13 17:09:45 +03:00
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"exemplar": false,
"expr": "pg_stat_database_numbackends{datname=~\"$Database\", instance=~\"$Instance\"}",
"instant": true,
2025-08-13 17:09:45 +03:00
"legendFormat": "{{datname}}",
2025-09-15 16:33:45 +03:00
"range": false,
2025-08-13 17:09:45 +03:00
"refId": "A"
}
],
2025-09-15 16:33:45 +03:00
"title": "Connections by database ",
"type": "barchart"
2025-08-13 17:09:45 +03:00
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
2025-09-15 16:33:45 +03:00
"mode": "thresholds"
2025-08-13 17:09:45 +03:00
},
2025-09-15 16:33:45 +03:00
"mappings": [],
2025-08-13 17:09:45 +03:00
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
}
]
2025-09-15 16:33:45 +03:00
}
2025-08-13 17:09:45 +03:00
},
"overrides": []
},
"gridPos": {
2025-09-15 16:33:45 +03:00
"h": 7,
2025-08-13 17:09:45 +03:00
"w": 5,
"x": 19,
"y": 16
},
2025-09-15 16:33:45 +03:00
"id": 39,
2025-08-13 17:09:45 +03:00
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
2025-09-15 16:33:45 +03:00
"orientation": "auto",
2025-08-13 17:09:45 +03:00
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
2025-09-15 16:33:45 +03:00
"text": {
"titleSize": 10
},
2025-08-13 17:09:45 +03:00
"textMode": "auto",
"wideLayout": true
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum(pg_settings_max_connections{instance=\"$Instance\"})",
"legendFormat": "__auto",
2025-08-13 17:09:45 +03:00
"range": true,
"refId": "A"
}
],
2025-09-15 16:33:45 +03:00
"title": "Max Connections",
2025-08-13 17:09:45 +03:00
"type": "stat"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 23
2025-08-13 17:09:45 +03:00
},
"id": 27,
"panels": [],
"title": "Transactions",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "1 Minute rate of transactions committed or rollback.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 24
2025-08-13 17:09:45 +03:00
},
"id": 14,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum ((rate(pg_stat_database_xact_commit[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "committed",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum ((rate(pg_stat_database_xact_rollback[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"hide": false,
"interval": "",
"legendFormat": "rollback",
"range": true,
"refId": "B"
}
],
"title": "Transactions",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Source: pg_stat_database",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 31
2025-08-13 17:09:45 +03:00
},
"id": 24,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_database_tup_inserted{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "Inserts",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_database_tup_updated{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "Updates",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_database_tup_deleted{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "Deletes",
"range": true,
"refId": "C"
}
],
"title": "Tuples inserts/updates/deletes",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 31
2025-08-13 17:09:45 +03:00
},
"id": 29,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
2025-08-15 10:11:45 +00:00
"disableTextWrap": false,
2025-08-13 17:09:45 +03:00
"editorMode": "code",
2025-08-15 10:11:45 +00:00
"expr": "pg_stat_activity_max_tx_duration",
"fullMetaSearch": false,
"includeNullMetadata": true,
2025-08-13 17:09:45 +03:00
"legendFormat": "{{instance}}",
"range": true,
2025-08-15 10:11:45 +00:00
"refId": "A",
"useBackend": false
2025-08-13 17:09:45 +03:00
}
],
"title": "Longest transition",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "* blk_read_time: Time spent reading data file blocks by backends in this database, in milliseconds\n* blk_write_time: Time spent writing data file blocks by backends in this database, in milliseconds\n\ntrack_io_timings needs to be activated",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "ms"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 38
2025-08-13 17:09:45 +03:00
},
"id": 25,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "sum ((rate(pg_stat_database_blk_read_time{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "blk_read_time",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "sum ((rate(pg_stat_database_blk_write_time{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "blk_read_time",
"refId": "B"
}
],
"title": "I/O Read/Write time",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Source: pg_stat_database\n\n* tup_fetched: rows needed to satisfy queries\n* tup_returned: rows read/scanned",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 38
2025-08-13 17:09:45 +03:00
},
"id": 26,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_database_tup_fetched{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "Fetched",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "sum((rate(pg_stat_database_tup_returned{instance=\"$Instance\"}[$__interval_ms])))",
2025-08-13 17:09:45 +03:00
"interval": "",
"legendFormat": "Returned",
"refId": "B"
}
],
"title": "Tuples fetched/returned",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 46
2025-08-13 17:09:45 +03:00
},
"id": 20,
"panels": [],
"title": "Queries",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 47
2025-08-13 17:09:45 +03:00
},
2025-09-15 16:33:45 +03:00
"id": 40,
2025-08-13 17:09:45 +03:00
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"disableTextWrap": false,
"editorMode": "code",
2025-09-17 15:23:54 +03:00
"expr": "topk(5,\r\n (\r\n increase(pg_stat_statements_seconds_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n /\r\n increase(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}\r\n",
2025-08-13 17:09:45 +03:00
"fullMetaSearch": false,
"includeNullMetadata": true,
2025-08-15 10:11:45 +00:00
"legendFormat": "{{datname}} : {{query}}",
2025-08-13 17:09:45 +03:00
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Top 5 Slowest Queries by Average Time",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
2025-09-15 16:33:45 +03:00
},
"unit": "s"
2025-08-13 17:09:45 +03:00
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 47
2025-08-13 17:09:45 +03:00
},
"id": 19,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"editorMode": "code",
2025-09-17 15:23:54 +03:00
"expr": "topk(5,\r\n increase(\r\n pg_stat_statements_seconds_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms]\r\n )\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}",
2025-08-15 10:11:45 +00:00
"legendFormat": "{{datname}} : {{query}}",
2025-08-13 17:09:45 +03:00
"range": true,
"refId": "A"
}
],
"title": "Top 5 Queries by Total Execution Time ",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 55
2025-08-13 17:09:45 +03:00
},
"id": 17,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"editorMode": "code",
2025-09-17 15:23:54 +03:00
"expr": "topk(5,\r\n increase(\r\n pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms]\r\n )\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}\r\n",
2025-08-15 10:11:45 +00:00
"legendFormat": "{{datname}} : {{query}}",
2025-08-13 17:09:45 +03:00
"range": true,
"refId": "A"
}
],
"title": "Top 5 Most Frequent Queries",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-13 17:09:45 +03:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 55
2025-08-13 17:09:45 +03:00
},
"id": 18,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-13 17:09:45 +03:00
"targets": [
{
"editorMode": "code",
2025-09-17 15:23:54 +03:00
"expr": "sum by (query) (\r\n increase(\r\n pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms]\r\n )\r\n *\r\n on(queryid, instance)\r\n group_left(query)\r\n pg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)",
2025-08-13 17:09:45 +03:00
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Total Queries Executed",
"type": "timeseries"
},
{
2025-08-15 10:11:45 +00:00
"collapsed": false,
2025-08-13 17:09:45 +03:00
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 63
2025-08-13 17:09:45 +03:00
},
"id": 28,
"panels": [],
"repeat": "Database",
"title": "Database: $Database",
"type": "row"
2025-08-15 10:11:45 +00:00
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "rgb(31, 120, 193)",
"mode": "fixed"
},
"decimals": 2,
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"overrides": []
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 64
2025-08-15 10:11:45 +00:00
},
"id": 35,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "pg_database_size_bytes{instance=\"$Instance\",datname=\"$Database\"}",
"range": true,
"refId": "A"
}
],
"title": "Database size",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Source: pg_stat_database",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"overrides": []
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 64
2025-08-15 10:11:45 +00:00
},
"id": 31,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
2025-08-13 17:09:45 +03:00
},
2025-08-15 10:11:45 +00:00
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_tup_inserted{instance=\"$instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"interval": "",
"legendFormat": "Inserts",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
2025-08-13 17:09:45 +03:00
},
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_tup_updated{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"interval": "",
"legendFormat": "Updates",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
2025-08-13 17:09:45 +03:00
},
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_tup_deleted{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"interval": "",
"legendFormat": "Deletes",
"refId": "C"
}
],
"title": "Tuples inserts/updates/deletes",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "1 Minute rate of transactions committed or rollback.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 72
2025-08-15 10:11:45 +00:00
},
"id": 30,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_xact_commit{instance=\"$instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"interval": "",
"legendFormat": "committed",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_xact_rollback{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"hide": false,
"interval": "",
"legendFormat": "rollback",
"refId": "B"
}
],
"title": "Transactions",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Source: pg_locks",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 72
2025-08-15 10:11:45 +00:00
},
"id": 33,
"links": [
{
"title": "PostgreSQL Lock Modes",
"url": "https://www.postgresql.org/docs/12/explicit-locking.html#LOCKING-TABLES"
}
],
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum by (mode) (pg_locks_count{instance=\"$Instance\",datname=\"$Database\"})",
"legendFormat": "{{mode}}",
"refId": "A"
}
],
"title": "Locks by state",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Source: pg_stat_database\n\n* tup_fetched: rows needed to satisfy queries\n* tup_returned: rows read/scanned",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 80
2025-08-15 10:11:45 +00:00
},
"id": 32,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_tup_fetched{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"interval": "",
"legendFormat": "Fetched",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
2025-09-15 16:33:45 +03:00
"expr": "rate(pg_stat_database_tup_returned{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])",
2025-08-15 10:11:45 +00:00
"interval": "",
"legendFormat": "Returned",
"refId": "B"
}
],
"title": "Tuples fetched/returned",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 80
2025-08-15 10:11:45 +00:00
},
"id": 36,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"editorMode": "code",
2025-09-17 15:23:54 +03:00
"expr": "topk(5,\r\n increase(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}",
2025-08-15 10:11:45 +00:00
"legendFormat": "{{query}}",
"range": true,
"refId": "A"
}
],
"title": "Top 5 Most Frequent Queries",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Source: pg_locks",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
2025-09-15 16:33:45 +03:00
"y": 88
2025-08-15 10:11:45 +00:00
},
"id": 34,
"links": [
{
"title": "PostgreSQL Lock Modes",
"url": "https://www.postgresql.org/docs/12/explicit-locking.html#LOCKING-TABLES"
}
],
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum by (mode) (pg_locks_count{instance=\"$Instance\",datname=\"$Database\"})",
"legendFormat": "{{mode}}",
"refId": "A"
}
],
"title": "Locks by state",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
2025-09-15 16:33:45 +03:00
"color": "green",
"value": 0
2025-08-15 10:11:45 +00:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
2025-09-15 16:33:45 +03:00
"y": 88
2025-08-15 10:11:45 +00:00
},
"id": 37,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
2025-09-15 16:33:45 +03:00
"pluginVersion": "12.1.0",
2025-08-15 10:11:45 +00:00
"targets": [
{
"disableTextWrap": false,
"editorMode": "code",
"expr": "topk(5,\r\n (\r\n pg_stat_statements_seconds_total{datname=~\"$Database\", instance=~\"$Instance\"}\r\n /\r\n pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}\r\n )\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "{{datname}} : {{query}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Top 5 Slowest Queries by Average Time by base",
"type": "timeseries"
}
],
"preload": false,
"schemaVersion": 41,
"tags": [],
"templating": {
"list": [
{
"current": {
2025-09-17 15:23:54 +03:00
"text": "rc1d-om3s5r3g9xdexbfa.mdb.yandexcloud.net:6432/db1",
"value": "rc1d-om3s5r3g9xdexbfa.mdb.yandexcloud.net:6432/db1"
2025-08-15 10:11:45 +00:00
},
"definition": "label_values({job=\"integrations/postgres-exporter\"},instance)",
"description": "",
"name": "Instance",
"options": [],
"query": {
"qryType": 1,
"query": "label_values({job=\"integrations/postgres-exporter\"},instance)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {
"text": "All",
"value": [
"$__all"
]
},
"definition": "label_values(pg_stat_database_tup_fetched{instance=\"$Instance\"},datname)",
"includeAll": true,
"multi": true,
"name": "Database",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(pg_stat_database_tup_fetched{instance=\"$Instance\"},datname)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "/^(?!template*|postgres).*$/",
"type": "query"
2025-08-13 17:09:45 +03:00
}
]
},
"time": {
2025-09-17 15:23:54 +03:00
"from": "now-15m",
2025-08-13 17:09:45 +03:00
"to": "now"
},
"timepicker": {},
"timezone": "browser",
2025-09-15 16:46:16 +03:00
"title": "PostgreSQL Exporter",
2025-09-17 15:23:54 +03:00
"uid": "46b92f7b-f2f1-49f8-ab31-87bbe5a03f0f",
"version": 7
2025-08-13 17:09:45 +03:00
}