Files
grafana-dashboards/postgresexporter-monitoring.json

2085 lines
51 KiB
JSON
Raw Normal View History

2025-08-13 13:45:22 +00:00
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
2025-08-13 13:45:22 +00:00
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 32,
2025-08-13 13:45:22 +00:00
"links": [],
"panels": [
{
"collapsed": false,
2025-08-13 13:45:22 +00:00
"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"
2025-08-13 13:45:22 +00:00
},
"mappings": [
2025-08-13 13:45:22 +00:00
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
2025-08-13 13:45:22 +00:00
},
"type": "special"
2025-08-13 13:45:22 +00:00
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
2025-08-13 13:45:22 +00:00
},
{
"color": "red",
"value": 80
2025-08-13 13:45:22 +00:00
}
]
2025-08-13 13:45:22 +00:00
},
"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"
2025-08-13 13:45:22 +00:00
],
"fields": "",
"values": false
2025-08-13 13:45:22 +00:00
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum((rate(pg_stat_statements_calls_total{instance=\"$Instance\"}[$Interval])))",
"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"
2025-08-13 13:45:22 +00:00
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
2025-08-13 13:45:22 +00:00
},
{
"color": "red",
"value": 80
}
]
}
},
"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": {
"calcs": [
"lastNotNull"
2025-08-13 13:45:22 +00:00
],
"fields": "/^pg_settings_shared_buffers_bytes\\{cluster=\"main\", instance=\"stage\\-new\\-0\\.stage\", job=\"integrations/postgres\\-exporter\", k8s_cluster_name=\"main\", server=\"stage\\-new\\-0:5432\"\\}$/",
"values": false
2025-08-13 13:45:22 +00:00
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "pg_settings_shared_buffers_bytes{instance=\"$Instance\"}",
"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": [
2025-08-13 13:45:22 +00:00
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
2025-08-13 13:45:22 +00:00
},
"type": "special"
2025-08-13 13:45:22 +00:00
}
],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red"
},
{
"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
2025-08-13 13:45:22 +00:00
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"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": [
2025-08-13 13:45:22 +00:00
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
2025-08-13 13:45:22 +00:00
},
"type": "special"
2025-08-13 13:45:22 +00:00
}
],
"max": 1,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-green"
2025-08-13 13:45:22 +00:00
},
{
"color": "semi-dark-yellow",
"value": 0.75
2025-08-13 13:45:22 +00:00
},
{
"color": "semi-dark-red",
"value": 0.9
}
]
2025-08-13 13:45:22 +00:00
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 14,
"y": 1
},
"id": 8,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"last"
2025-08-13 13:45:22 +00:00
],
"fields": "",
"values": false
2025-08-13 13:45:22 +00:00
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"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": [
2025-08-13 13:45:22 +00:00
{
"options": {
"match": "null",
"result": {
"text": "N/A"
2025-08-13 13:45:22 +00:00
}
},
"type": "special"
2025-08-13 13:45:22 +00:00
}
],
"max": 1,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red"
2025-08-13 13:45:22 +00:00
},
{
"color": "#EAB839",
"value": 0.75
2025-08-13 13:45:22 +00:00
},
{
"color": "semi-dark-green",
"value": 0.9
2025-08-13 13:45:22 +00:00
}
]
2025-08-13 13:45:22 +00:00
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 19,
"y": 1
},
"id": 9,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
2025-08-13 13:45:22 +00:00
],
"fields": "",
"values": false
2025-08-13 13:45:22 +00:00
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"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"
2025-08-13 13:45:22 +00:00
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
2025-08-13 13:45:22 +00:00
{
"color": "green"
2025-08-13 13:45:22 +00:00
},
{
"color": "red",
"value": 80
2025-08-13 13:45:22 +00:00
}
]
},
"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"
2025-08-13 13:45:22 +00:00
],
"fields": "",
"values": false
2025-08-13 13:45:22 +00:00
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum((rate(pg_stat_database_xact_commit{instance=\"$Instance\"}[$Interval])))+sum((rate(pg_stat_database_xact_rollback{instance=\"$Instance\"}[$Interval])))",
"interval": "",
"legendFormat": "",
"range": true,
"refId": "A"
2025-08-13 13:45:22 +00:00
}
],
"title": "Transaction rate",
"type": "stat"
2025-08-13 13:45:22 +00:00
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
2025-08-13 13:45:22 +00:00
},
"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"
2025-08-13 13:45:22 +00:00
},
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
2025-08-13 13:45:22 +00:00
}
},
"type": "special"
2025-08-13 13:45:22 +00:00
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
2025-08-13 13:45:22 +00: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"
2025-08-13 13:45:22 +00:00
],
"fields": "",
"values": false
2025-08-13 13:45:22 +00:00
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"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"
},
"description": "Setting: max_connections in postgreSQL.conf",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
2025-08-13 13:45:22 +00:00
},
"mappings": [
2025-08-13 13:45:22 +00:00
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
2025-08-13 13:45:22 +00:00
},
"type": "special"
2025-08-13 13:45:22 +00:00
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
2025-08-13 13:45:22 +00:00
},
{
"color": "red",
"value": 80
2025-08-13 13:45:22 +00:00
}
]
2025-08-13 13:45:22 +00:00
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 9,
"x": 0,
"y": 9
},
"id": 10,
"maxDataPoints": 100,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
2025-08-13 13:45:22 +00:00
],
"fields": "/^pg_settings_max_connections\\{cluster=\"main\", instance=\"stage\\-new\\-0\\.stage\", job=\"integrations/postgres\\-exporter\", k8s_cluster_name=\"main\", server=\"stage\\-new\\-0:5432\"\\}$/",
"values": false
2025-08-13 13:45:22 +00:00
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "pg_settings_max_connections{instance=\"$Instance\"}",
"range": true,
"refId": "A"
}
],
"title": "Max Connections",
"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
2025-08-13 13:45:22 +00:00
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
2025-08-13 13:45:22 +00:00
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
2025-08-13 13:45:22 +00:00
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
2025-08-13 13:45:22 +00:00
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 15,
"x": 9,
"y": 9
},
"id": 21,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
2025-08-13 13:45:22 +00:00
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"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"
},
"description": "View: pg_stat_activity",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
2025-08-13 13:45:22 +00:00
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
2025-08-13 13:45:22 +00:00
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
2025-08-13 13:45:22 +00:00
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
2025-08-13 13:45:22 +00:00
},
"thresholdsStyle": {
"mode": "off"
2025-08-13 13:45:22 +00:00
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
2025-08-13 13:45:22 +00:00
},
{
"color": "red",
"value": 80
2025-08-13 13:45:22 +00:00
}
]
2025-08-13 13:45:22 +00:00
},
"unit": "short"
2025-08-13 13:45:22 +00:00
},
"overrides": [
{
"matcher": {
"id": "byValue",
"options": {
"op": "gte",
"reducer": "allIsZero",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": true,
"tooltip": true,
2025-08-13 13:45:22 +00:00
"viz": false
}
}
]
2025-08-13 13:45:22 +00:00
},
{
"matcher": {
"id": "byValue",
"options": {
"op": "gte",
"reducer": "allIsNull",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": true,
"tooltip": true,
2025-08-13 13:45:22 +00:00
"viz": false
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 19,
"x": 0,
"y": 16
},
"id": 23,
"interval": "$Interval",
"links": [
{
"targetBlank": true,
"title": "PostgreSQL Documentation",
"url": "https://www.postgresql.org/docs/current/monitoring-stats.html"
}
],
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
2025-08-13 13:45:22 +00:00
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
2025-08-13 13:45:22 +00:00
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum by (datname) (\r\n pg_stat_database_numbackends{instance=~\"$Instance\", datname=~\"$Database\"}\r\n)",
"legendFormat": "{{datname}}",
"range": true,
"refId": "A"
2025-08-13 13:45:22 +00:00
}
],
"title": "Connections by database (stacked)",
"type": "timeseries"
2025-08-13 13:45:22 +00:00
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"description": "Size of all databases in $Instance.\n\nSource: pg_database_size()",
2025-08-13 13:45:22 +00:00
"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"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 19,
"y": 16
2025-08-13 13:45:22 +00:00
},
"id": 5,
2025-08-13 13:45:22 +00:00
"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": "11.6.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"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 24
},
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 25
},
"id": 14,
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
2025-08-13 13:45:22 +00:00
},
"pluginVersion": "11.6.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum ((rate(pg_stat_database_xact_commit[$Interval])))",
"interval": "",
"legendFormat": "committed",
2025-08-13 13:45:22 +00:00
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum ((rate(pg_stat_database_xact_rollback[$Interval])))",
"hide": false,
"interval": "",
"legendFormat": "rollback",
"range": true,
"refId": "B"
2025-08-13 13:45:22 +00:00
}
],
"title": "Transactions",
"type": "timeseries"
2025-08-13 13:45:22 +00:00
},
{
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 7,
2025-08-13 13:45:22 +00:00
"w": 12,
"x": 0,
"y": 32
2025-08-13 13:45:22 +00:00
},
"id": 24,
2025-08-13 13:45:22 +00:00
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum((rate(pg_stat_database_tup_inserted{instance=\"$Instance\"}[$Interval])))",
2025-08-13 13:45:22 +00:00
"interval": "",
"legendFormat": "Inserts",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum((rate(pg_stat_database_tup_updated{instance=\"$Instance\"}[$Interval])))",
2025-08-13 13:45:22 +00:00
"interval": "",
"legendFormat": "Updates",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"editorMode": "code",
"expr": "sum((rate(pg_stat_database_tup_deleted{instance=\"$Instance\"}[$Interval])))",
2025-08-13 13:45:22 +00:00
"interval": "",
"legendFormat": "Deletes",
"range": true,
2025-08-13 13:45:22 +00:00
"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,
2025-08-13 13:45:22 +00:00
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
2025-08-13 13:45:22 +00:00
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
2025-08-13 13:45:22 +00:00
},
"overrides": []
},
"gridPos": {
"h": 7,
2025-08-13 13:45:22 +00:00
"w": 12,
"x": 12,
"y": 32
2025-08-13 13:45:22 +00:00
},
"id": 29,
2025-08-13 13:45:22 +00:00
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
2025-08-13 13:45:22 +00:00
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
2025-08-13 13:45:22 +00:00
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"editorMode": "code",
"expr": "time() - pg_long_running_transactions_oldest_timestamp_seconds",
"legendFormat": "{{instance}}",
2025-08-13 13:45:22 +00:00
"range": true,
"refId": "A"
}
],
"title": "Longest transition",
2025-08-13 13:45:22 +00:00
"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",
2025-08-13 13:45:22 +00:00
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "ms"
2025-08-13 13:45:22 +00:00
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 39
2025-08-13 13:45:22 +00:00
},
"id": 25,
2025-08-13 13:45:22 +00:00
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum ((rate(pg_stat_database_blk_read_time{instance=\"$Instance\"}[$Interval])))",
"interval": "",
"legendFormat": "blk_read_time",
2025-08-13 13:45:22 +00:00
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum ((rate(pg_stat_database_blk_write_time{instance=\"$Instance\"}[$Interval])))",
"interval": "",
"legendFormat": "blk_read_time",
"refId": "B"
2025-08-13 13:45:22 +00:00
}
],
"title": "I/O Read/Write time",
2025-08-13 13:45:22 +00:00
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
2025-08-13 13:45:22 +00:00
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 39
2025-08-13 13:45:22 +00:00
},
"id": 26,
2025-08-13 13:45:22 +00:00
"options": {
"dataLinks": [],
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum((rate(pg_stat_database_tup_fetched{instance=\"$Instance\"}[$Interval])))",
2025-08-13 13:45:22 +00:00
"interval": "",
"legendFormat": "Fetched",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "sum((rate(pg_stat_database_tup_returned{instance=\"$Instance\"}[$Interval])))",
2025-08-13 13:45:22 +00:00
"interval": "",
"legendFormat": "Returned",
"refId": "B"
}
],
"title": "Tuples fetched/returned",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 47
},
"id": 20,
"panels": [],
"title": "Queries",
"type": "row"
},
2025-08-13 13:45:22 +00:00
{
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 48
2025-08-13 13:45:22 +00:00
},
"id": 16,
2025-08-13 13:45:22 +00:00
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"disableTextWrap": false,
2025-08-13 13:45:22 +00:00
"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,
2025-08-13 13:45:22 +00:00
"legendFormat": "{{query}}",
"range": true,
"refId": "A",
"useBackend": false
2025-08-13 13:45:22 +00:00
}
],
"title": "Top 5 Slowest Queries by Average Time",
2025-08-13 13:45:22 +00:00
"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,
2025-08-13 13:45:22 +00:00
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
2025-08-13 13:45:22 +00:00
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
2025-08-13 13:45:22 +00:00
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 48
2025-08-13 13:45:22 +00:00
},
"id": 19,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
2025-08-13 13:45:22 +00:00
{
"editorMode": "code",
"expr": "topk(5,\r\n pg_stat_statements_seconds_total{datname=~\"$Database\", instance=~\"$Instance\"}\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}",
"legendFormat": "{{query}}",
"range": true,
"refId": "A"
2025-08-13 13:45:22 +00:00
}
],
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 56
},
"id": 17,
2025-08-13 13:45:22 +00:00
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
2025-08-13 13:45:22 +00:00
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
2025-08-13 13:45:22 +00:00
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"editorMode": "code",
"expr": "topk(5,\r\n increase(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[1h])\r\n)\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}",
"legendFormat": "{{query}}",
"range": true,
2025-08-13 13:45:22 +00:00
"refId": "A"
}
],
"title": "Top 5 Most Frequent Queries",
2025-08-13 13:45:22 +00:00
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 56
2025-08-13 13:45:22 +00:00
},
"id": 18,
2025-08-13 13:45:22 +00:00
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"targets": [
{
"editorMode": "code",
"expr": "sum by (query) (\r\n pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}\r\n*\r\non(queryid, instance)\r\ngroup_left(query)\r\npg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)",
"legendFormat": "__auto",
2025-08-13 13:45:22 +00:00
"range": true,
"refId": "A"
2025-08-13 13:45:22 +00:00
}
],
"title": "Total Queries Executed",
2025-08-13 13:45:22 +00:00
"type": "timeseries"
},
{
"collapsed": true,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 64
},
"id": 28,
"panels": [],
"repeat": "Database",
"title": "Database: $Database",
"type": "row"
2025-08-13 13:45:22 +00:00
}
],
"preload": false,
"schemaVersion": 41,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "stage-new-0.stage",
"value": "stage-new-0.stage"
},
"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(datname)",
"includeAll": true,
"multi": true,
"name": "Database",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(datname)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "/^(?!template*|postgres).*$/",
"type": "query"
},
{
"auto": true,
"auto_count": 30,
"auto_min": "10s",
"current": {
"text": "10m",
"value": "10m"
2025-08-13 13:45:22 +00:00
},
"name": "Interval",
"options": [
{
"selected": false,
"text": "1m",
"value": "1m"
},
{
"selected": true,
2025-08-13 13:45:22 +00:00
"text": "10m",
"value": "10m"
},
{
"selected": false,
"text": "30m",
"value": "30m"
},
{
"selected": false,
2025-08-13 13:45:22 +00:00
"text": "1h",
"value": "1h"
},
{
"selected": false,
"text": "6h",
"value": "6h"
},
{
"selected": false,
"text": "12h",
"value": "12h"
},
{
"selected": false,
"text": "1d",
"value": "1d"
},
{
"selected": false,
"text": "7d",
"value": "7d"
},
{
"selected": false,
"text": "14d",
"value": "14d"
},
{
"selected": false,
"text": "30d",
"value": "30d"
}
],
"query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2,
"type": "interval"
}
]
},
"time": {
"from": "now-3h",
2025-08-13 13:45:22 +00:00
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "All_postgress",
2025-08-13 17:08:12 +03:00
"uid": "asdqwe123",
"version": 56
2025-08-13 13:45:22 +00:00
}