Обновить postgresexporter.json

This commit is contained in:
2025-08-15 10:11:45 +00:00
parent ecf0eabd70
commit eab6e526ad

View File

@@ -18,7 +18,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 32,
"id": 70,
"links": [],
"panels": [
{
@@ -638,7 +638,7 @@
"calcs": [
"lastNotNull"
],
"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\"\\}$/",
"fields": "/^pg_settings_max_connections\\{cluster=\"yandex\", exported_instance=\"postgres\\-prod\", instance=\"postgres\\-exporter\\-0\\.monitoring\", job=\"integrations/postgres\\-exporter\", k8s_cluster_name=\"yandex\", server=\"rc1d\\-om3s5r3g9xdexbfa\\.mdb\\.yandexcloud\\.net:6432\"\\}$/",
"values": false
},
"showPercentChange": false,
@@ -1326,11 +1326,15 @@
"pluginVersion": "11.6.0",
"targets": [
{
"disableTextWrap": false,
"editorMode": "code",
"expr": "time() - pg_long_running_transactions_oldest_timestamp_seconds",
"expr": "pg_stat_activity_max_tx_duration",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "{{instance}}",
"range": true,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Longest transition",
@@ -1662,7 +1666,7 @@
"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": "{{query}}",
"legendFormat": "{{datname}} : {{query}}",
"range": true,
"refId": "A",
"useBackend": false
@@ -1755,7 +1759,7 @@
{
"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}}",
"legendFormat": "{{datname}} : {{query}}",
"range": true,
"refId": "A"
}
@@ -1847,7 +1851,7 @@
{
"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}}",
"legendFormat": "{{datname}} : {{query}}",
"range": true,
"refId": "A"
}
@@ -1948,7 +1952,7 @@
"type": "timeseries"
},
{
"collapsed": true,
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
@@ -1960,6 +1964,843 @@
"repeat": "Database",
"title": "Database: $Database",
"type": "row"
},
{
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 65
},
"id": 35,
"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": "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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 65
},
"id": 31,
"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": "rate(pg_stat_database_tup_inserted{instance=\"$instance\",datname=\"$Database\"}[$Interval])",
"interval": "",
"legendFormat": "Inserts",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "rate(pg_stat_database_tup_updated{instance=\"$Instance\",datname=\"$Database\"}[$Interval])",
"interval": "",
"legendFormat": "Updates",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "rate(pg_stat_database_tup_deleted{instance=\"$Instance\",datname=\"$Database\"}[$Interval])",
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 73
},
"id": 30,
"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": "rate(pg_stat_database_xact_commit{instance=\"$instance\",datname=\"$Database\"}[$Interval])",
"interval": "",
"legendFormat": "committed",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "rate(pg_stat_database_xact_rollback{instance=\"$Instance\",datname=\"$Database\"}[$Interval])",
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 73
},
"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"
}
},
"pluginVersion": "11.6.0",
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 81
},
"id": 32,
"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": "rate(pg_stat_database_tup_fetched{instance=\"$Instance\",datname=\"$Database\"}[$Interval])",
"interval": "",
"legendFormat": "Fetched",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prom"
},
"expr": "rate(pg_stat_database_tup_returned{instance=\"$Instance\",datname=\"$Database\"}[$Interval])",
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 81
},
"id": 36,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"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,
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 89
},
"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"
}
},
"pluginVersion": "11.6.0",
"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": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 89
},
"id": 37,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.0",
"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,
@@ -1969,8 +2810,8 @@
"list": [
{
"current": {
"text": "stage-new-0.stage",
"value": "stage-new-0.stage"
"text": "postgres-exporter-0.monitoring",
"value": "postgres-exporter-0.monitoring"
},
"definition": "label_values({job=\"integrations/postgres-exporter\"},instance)",
"description": "",
@@ -1992,14 +2833,14 @@
"$__all"
]
},
"definition": "label_values(datname)",
"definition": "label_values(pg_stat_database_tup_fetched{instance=\"$Instance\"},datname)",
"includeAll": true,
"multi": true,
"name": "Database",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(datname)",
"query": "label_values(pg_stat_database_tup_fetched{instance=\"$Instance\"},datname)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
@@ -2011,8 +2852,8 @@
"auto_count": 30,
"auto_min": "10s",
"current": {
"text": "10m",
"value": "10m"
"text": "1h",
"value": "1h"
},
"name": "Interval",
"options": [
@@ -2022,7 +2863,7 @@
"value": "1m"
},
{
"selected": true,
"selected": false,
"text": "10m",
"value": "10m"
},
@@ -2032,7 +2873,7 @@
"value": "30m"
},
{
"selected": false,
"selected": true,
"text": "1h",
"value": "1h"
},
@@ -2074,12 +2915,12 @@
]
},
"time": {
"from": "now-3h",
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "All_postgress",
"uid": "asdqwe123",
"version": 56
"title": "PostgreSQL Exporter",
"uid": "Postgesexporter",
"version": 6
}