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-12-05 11:12:21 +03:00
"id" : 45 ,
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
} ,
2025-10-15 11:20:49 +03:00
"id" : 20 ,
2025-08-13 17:09:45 +03:00
"panels" : [ ] ,
2025-10-15 11:20:49 +03:00
"title" : "Queries" ,
2025-08-13 17:09:45 +03:00
"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" ,
2025-10-15 11:20:49 +03:00
"fillOpacity" : 20 ,
2025-08-13 17:09:45 +03:00
"gradientMode" : "none" ,
"hideFrom" : {
"legend" : false ,
"tooltip" : false ,
"viz" : false
} ,
"insertNulls" : false ,
"lineInterpolation" : "linear" ,
2025-10-15 11:20:49 +03:00
"lineWidth" : 2 ,
2025-08-13 17:09:45 +03:00
"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
}
]
} ,
2025-10-15 11:20:49 +03:00
"unit" : "ops"
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
2025-10-15 11:20:49 +03:00
"h" : 9 ,
2025-08-13 17:09:45 +03:00
"w" : 24 ,
"x" : 0 ,
2025-09-15 16:33:45 +03:00
"y" : 24
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 40 ,
2025-08-13 17:09:45 +03:00
"options" : {
"legend" : {
"calcs" : [
"mean" ,
2025-10-15 11:20:49 +03:00
"max" ,
"min"
2025-08-13 17:09:45 +03:00
] ,
"displayMode" : "table" ,
2025-10-15 11:20:49 +03:00
"placement" : "right" ,
"showLegend" : true ,
"sortBy" : "Max" ,
"sortDesc" : false
2025-08-13 17:09:45 +03:00
} ,
"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-10-15 11:20:49 +03:00
"disableTextWrap" : false ,
2025-08-13 17:09:45 +03:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "sum by(datname) (\r\n rate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n)\r\nor\r\nsum by(datname) (\r\n irate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n)" ,
"format" : "time_series" ,
"fullMetaSearch" : false ,
"includeNullMetadata" : true ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "__auto" ,
2025-08-13 17:09:45 +03:00
"range" : true ,
2025-10-15 11:20:49 +03:00
"refId" : "A" ,
"useBackend" : false
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Statements Calls" ,
2025-08-13 17:09:45 +03:00
"type" : "timeseries"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"fieldConfig" : {
"defaults" : {
"custom" : {
2025-10-15 11:20:49 +03:00
"align" : "auto" ,
"cellOptions" : {
"type" : "auto"
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"inspect" : false
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"decimals" : 2 ,
"displayName" : "" ,
2025-08-13 17:09:45 +03:00
"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-10-15 11:20:49 +03:00
"unit" : "short"
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"overrides" : [
{
"matcher" : {
"id" : "byName" ,
"options" : "queryid"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Query ID"
} ,
{
"id" : "custom.align"
} ,
{
"id" : "unit"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "Time"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Time"
} ,
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "Value"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Calls/sec"
} ,
{
"id" : "unit" ,
"value" : "ops"
} ,
{
"id" : "custom.cellOptions" ,
"value" : {
"type" : "color-text"
}
} ,
{
"id" : "custom.align"
} ,
{
"id" : "thresholds" ,
"value" : {
"mode" : "absolute" ,
"steps" : [
{
"color" : "rgba(50, 172, 45, 0.97)" ,
"value" : 0
} ,
{
"color" : "rgba(237, 129, 40, 0.89)" ,
"value" : 100
} ,
{
"color" : "rgba(245, 54, 54, 0.9)" ,
"value" : 1000
} ,
{
"value" : 10000
}
]
}
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "instance"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "job"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "tier"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "type"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "query"
} ,
"properties" : [
{
"id" : "custom.width" ,
"value" : 217
}
]
}
]
2025-08-13 17:09:45 +03:00
} ,
"gridPos" : {
2025-10-15 11:20:49 +03:00
"h" : 10 ,
"w" : 24 ,
2025-08-13 17:09:45 +03:00
"x" : 0 ,
2025-10-15 11:20:49 +03:00
"y" : 33
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 41 ,
"links" : [
{
"url" : "/"
}
] ,
2025-08-13 17:09:45 +03:00
"options" : {
2025-10-15 11:20:49 +03:00
"cellHeight" : "sm" ,
"footer" : {
"countRows" : false ,
"fields" : "" ,
"reducer" : [
"sum"
2025-08-13 17:09:45 +03:00
] ,
2025-10-15 11:20:49 +03:00
"show" : false
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"showHeader" : true ,
"sortBy" : [
{
"desc" : true ,
"displayName" : "Query ID"
}
]
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" : [
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"disableTextWrap" : false ,
"dsType" : "influxdb" ,
2025-08-13 17:09:45 +03:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "(\r\n sort_desc(\r\n topk(\r\n 10,\r\n rate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n )\r\n or irate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n)\r\n* on (queryid, instance)\r\ngroup_left(query)\r\nmax by (instance, queryid, query) (\r\n pg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)\r\n" ,
"format" : "table" ,
"fullMetaSearch" : false ,
"groupBy" : [
{
"params" : [
"$__interval"
] ,
"type" : "time"
} ,
{
"params" : [
"null"
] ,
"type" : "fill"
}
] ,
"hide" : false ,
"includeNullMetadata" : true ,
"instant" : true ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "" ,
"orderByTime" : "ASC" ,
"policy" : "default" ,
"refId" : "A" ,
"resultFormat" : "time_series" ,
"select" : [
[
{
"params" : [
"value"
] ,
"type" : "field"
} ,
{
"params" : [ ] ,
"type" : "mean"
}
]
] ,
"tags" : [ ] ,
"useBackend" : false
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Most Called Queries" ,
"type" : "table"
2025-08-13 17:09:45 +03: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" : [
{
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-12-05 11:12:21 +03:00
} ,
"unit" : "ms"
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
2025-10-15 11:20:49 +03:00
"h" : 8 ,
"w" : 24 ,
"x" : 0 ,
"y" : 43
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 42 ,
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" : [
{
2025-10-15 11:20:49 +03:00
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-08-15 10:11:45 +00:00
"disableTextWrap" : false ,
2025-10-15 11:20:49 +03:00
"editorMode" : "builder" ,
"expr" : "(sum by(datname) (rate(pg_stat_statements_seconds_total{datname=~\"$Database\", instance=\"$Instance\"}[$__interval_ms])) > 0) or (irate(pg_stat_statements_time_milliseconds{datname=~\"$datname\", instance=\"$host\"}[5m]))" ,
"format" : "time_series" ,
2025-08-15 10:11:45 +00:00
"fullMetaSearch" : false ,
"includeNullMetadata" : true ,
2025-10-15 11:20:49 +03:00
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "{{datname}}" ,
2025-08-13 17:09:45 +03:00
"range" : true ,
2025-08-15 10:11:45 +00:00
"refId" : "A" ,
"useBackend" : false
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Total Duration of Queries" ,
2025-08-13 17:09:45 +03:00
"type" : "timeseries"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"fieldConfig" : {
"defaults" : {
"custom" : {
2025-10-15 11:20:49 +03:00
"align" : "auto" ,
"cellOptions" : {
"type" : "auto"
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"inspect" : false
} ,
"mappings" : [ ] ,
"thresholds" : {
"mode" : "absolute" ,
"steps" : [
{
"color" : "green" ,
"value" : 0
} ,
{
"color" : "red" ,
"value" : 80
}
]
}
} ,
"overrides" : [ ]
} ,
"gridPos" : {
"h" : 7 ,
"w" : 24 ,
"x" : 0 ,
"y" : 51
} ,
"id" : 44 ,
"options" : {
"cellHeight" : "sm" ,
"footer" : {
"countRows" : false ,
"fields" : "" ,
"reducer" : [
"sum"
] ,
"show" : false
} ,
"showHeader" : true
} ,
"pluginVersion" : "12.1.0" ,
"targets" : [
{
"datasource" : {
"uid" : "Prometheus"
} ,
"disableTextWrap" : false ,
"dsType" : "influxdb" ,
"editorMode" : "code" ,
"expr" : "topk(\r\n 10,\r\n (\r\n rate(pg_stat_statements_seconds_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n /\r\n rate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n)\r\n* on (queryid, instance)\r\ngroup_left(query)\r\nmax by (instance, queryid, query) (\r\n pg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)\r\n" ,
"format" : "table" ,
"fullMetaSearch" : false ,
"groupBy" : [
{
"params" : [
"$__interval"
] ,
"type" : "time"
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
{
"params" : [
"null"
] ,
"type" : "fill"
2025-08-13 17:09:45 +03:00
}
2025-10-15 11:20:49 +03:00
] ,
"hide" : false ,
"includeNullMetadata" : true ,
"instant" : true ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "" ,
"orderByTime" : "ASC" ,
"policy" : "default" ,
"refId" : "A" ,
"resultFormat" : "time_series" ,
"select" : [
[
{
"params" : [
"value"
] ,
"type" : "field"
} ,
{
"params" : [ ] ,
"type" : "mean"
}
]
] ,
"tags" : [ ] ,
"useBackend" : false
}
] ,
"title" : "Average Runtime" ,
"type" : "table"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"fieldConfig" : {
"defaults" : {
"custom" : {
"align" : "auto" ,
"cellOptions" : {
"type" : "auto"
} ,
"inspect" : false
2025-08-13 17:09:45 +03:00
} ,
"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-10-15 11:20:49 +03:00
}
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
2025-10-15 11:20:49 +03:00
"h" : 7 ,
"w" : 24 ,
2025-08-13 17:09:45 +03:00
"x" : 0 ,
2025-10-15 11:20:49 +03:00
"y" : 58
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 43 ,
2025-08-13 17:09:45 +03:00
"options" : {
2025-10-15 11:20:49 +03:00
"cellHeight" : "sm" ,
"footer" : {
"countRows" : false ,
"fields" : "" ,
"reducer" : [
"sum"
2025-08-13 17:09:45 +03:00
] ,
2025-10-15 11:20:49 +03:00
"show" : false
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"showHeader" : true
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" : [
{
"datasource" : {
2025-10-15 11:20:49 +03:00
"uid" : "Prometheus"
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"disableTextWrap" : false ,
"dsType" : "influxdb" ,
"editorMode" : "code" ,
"expr" : "sort_desc(topk(10, rate(pg_stat_database_active_time_seconds_total{datname=~\"$Database\", instance=\"$Instance\"}[$__interval_ms])))" ,
"format" : "table" ,
"fullMetaSearch" : false ,
"groupBy" : [
{
"params" : [
"$__interval"
] ,
"type" : "time"
} ,
{
"params" : [
"null"
] ,
"type" : "fill"
}
] ,
"hide" : false ,
"includeNullMetadata" : true ,
"instant" : true ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "" ,
"orderByTime" : "ASC" ,
"policy" : "default" ,
"refId" : "A" ,
"resultFormat" : "time_series" ,
"select" : [
[
{
"params" : [
"value"
] ,
"type" : "field"
} ,
{
"params" : [ ] ,
"type" : "mean"
}
]
] ,
"tags" : [ ] ,
"useBackend" : false
}
] ,
"title" : "Queries Duration" ,
"type" : "table"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"fieldConfig" : {
"defaults" : {
"custom" : {
"align" : "auto" ,
"cellOptions" : {
"type" : "auto"
} ,
"inspect" : false
} ,
"decimals" : 2 ,
"displayName" : "" ,
"mappings" : [ ] ,
"thresholds" : {
"mode" : "absolute" ,
"steps" : [
{
"color" : "green" ,
"value" : 0
} ,
{
"color" : "red" ,
"value" : 80
}
]
} ,
"unit" : "short"
} ,
"overrides" : [
{
"matcher" : {
"id" : "byName" ,
"options" : "Time"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Time"
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "queryid"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Query ID"
} ,
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.align"
} ,
{
"id" : "unit"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : ""
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "Value"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Duration"
} ,
{
"id" : "unit" ,
"value" : "ms"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.align"
}
]
}
]
} ,
"gridPos" : {
"h" : 8 ,
"w" : 24 ,
"x" : 0 ,
"y" : 65
} ,
"id" : 45 ,
"options" : {
"cellHeight" : "sm" ,
"footer" : {
"countRows" : false ,
"fields" : "" ,
"reducer" : [
"sum"
] ,
"show" : false
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"showHeader" : true
} ,
"pluginVersion" : "12.1.0" ,
"targets" : [
2025-08-13 17:09:45 +03:00
{
"datasource" : {
2025-10-15 11:20:49 +03:00
"uid" : "Prometheus"
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"disableTextWrap" : false ,
"dsType" : "influxdb" ,
"editorMode" : "code" ,
"expr" : "(\r\n sort_desc(\r\n topk(\r\n 5,\r\n sum by(queryid, datname, user) (\r\n irate(pg_stat_statements_seconds_total{instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n )\r\n )\r\n unless (\r\n topk(\r\n 20,\r\n sum by(queryid, datname, user) (\r\n irate(pg_stat_statements_time_milliseconds{instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n )\r\n )\r\n)\r\n* on (queryid)\r\ngroup_left(instance, query)\r\nmax by (instance, queryid, query) (\r\n pg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)\r\n" ,
"format" : "table" ,
"fullMetaSearch" : false ,
"groupBy" : [
{
"params" : [
"$__interval"
] ,
"type" : "time"
} ,
{
"params" : [
"null"
] ,
"type" : "fill"
}
] ,
"hide" : false ,
"includeNullMetadata" : true ,
"instant" : false ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "" ,
"orderByTime" : "ASC" ,
"policy" : "default" ,
"refId" : "A" ,
"resultFormat" : "time_series" ,
"select" : [
[
{
"params" : [
"value"
] ,
"type" : "field"
} ,
{
"params" : [ ] ,
"type" : "mean"
}
]
] ,
"tags" : [ ] ,
"useBackend" : false
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "New Slow Queries for All Databases" ,
"type" : "table"
} ,
{
"collapsed" : false ,
"gridPos" : {
"h" : 1 ,
"w" : 24 ,
"x" : 0 ,
"y" : 73
} ,
"id" : 27 ,
"panels" : [ ] ,
"title" : "Transactions" ,
"type" : "row"
2025-08-13 17:09:45 +03:00
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"description" : "1 Minute rate of transactions committed or rollback." ,
2025-08-13 17:09:45 +03: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" : [ ] ,
"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" : {
2025-10-15 11:20:49 +03:00
"h" : 7 ,
"w" : 24 ,
"x" : 0 ,
"y" : 74
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 14 ,
2025-08-13 17:09:45 +03:00
"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-10-15 11:20:49 +03:00
"editorMode" : "code" ,
"expr" : "sum ((delta(pg_stat_database_xact_commit[$__interval_ms])))" ,
2025-08-13 17:09:45 +03:00
"interval" : "" ,
2025-10-15 11:20:49 +03:00
"legendFormat" : "committed" ,
"range" : true ,
2025-08-13 17:09:45 +03:00
"refId" : "A"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"editorMode" : "code" ,
"expr" : "sum ((delta(pg_stat_database_xact_rollback[$__interval_ms])))" ,
"hide" : false ,
2025-08-13 17:09:45 +03:00
"interval" : "" ,
2025-10-15 11:20:49 +03:00
"legendFormat" : "rollback" ,
"range" : true ,
2025-08-13 17:09:45 +03:00
"refId" : "B"
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Transactions" ,
2025-08-13 17:09:45 +03:00
"type" : "timeseries"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"description" : "Source: pg_stat_database" ,
2025-08-13 17:09:45 +03:00
"fieldConfig" : {
"defaults" : {
"color" : {
"mode" : "palette-classic"
} ,
"custom" : {
"axisBorderShow" : false ,
"axisCenteredZero" : false ,
"axisColorMode" : "text" ,
"axisLabel" : "" ,
"axisPlacement" : "auto" ,
"barAlignment" : 0 ,
"barWidthFactor" : 0.6 ,
"drawStyle" : "line" ,
2025-10-15 11:20:49 +03:00
"fillOpacity" : 10 ,
2025-08-13 17:09:45 +03:00
"gradientMode" : "none" ,
"hideFrom" : {
"legend" : false ,
"tooltip" : false ,
"viz" : false
} ,
"insertNulls" : false ,
"lineInterpolation" : "linear" ,
"lineWidth" : 1 ,
"pointSize" : 5 ,
"scaleDistribution" : {
"type" : "linear"
} ,
2025-10-15 11:20:49 +03:00
"showPoints" : "never" ,
2025-08-13 17:09:45 +03:00
"spanNulls" : false ,
"stacking" : {
"group" : "A" ,
"mode" : "none"
} ,
"thresholdsStyle" : {
"mode" : "off"
}
} ,
"mappings" : [ ] ,
2025-10-15 11:20:49 +03:00
"min" : 0 ,
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
} ,
{
"color" : "red" ,
"value" : 80
}
]
2025-10-15 11:20:49 +03:00
} ,
"unit" : "none"
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
2025-10-15 11:20:49 +03:00
"h" : 7 ,
2025-08-13 17:09:45 +03:00
"w" : 12 ,
"x" : 0 ,
2025-10-15 11:20:49 +03:00
"y" : 81
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 24 ,
2025-08-13 17:09:45 +03:00
"options" : {
2025-10-15 11:20:49 +03:00
"dataLinks" : [ ] ,
2025-08-13 17:09:45 +03:00
"legend" : {
2025-10-15 11:20:49 +03:00
"calcs" : [
"mean" ,
"lastNotNull" ,
"max"
] ,
"displayMode" : "table" ,
2025-08-13 17:09:45 +03:00
"placement" : "bottom" ,
"showLegend" : true
} ,
"tooltip" : {
"hideZeros" : false ,
2025-10-15 11:20:49 +03:00
"mode" : "multi" ,
2025-08-13 17:09:45 +03:00
"sort" : "none"
}
} ,
2025-09-15 16:33:45 +03:00
"pluginVersion" : "12.1.0" ,
2025-08-13 17:09:45 +03:00
"targets" : [
{
2025-10-15 11:20:49 +03:00
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-08-13 17:09:45 +03:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "sum((delta(pg_stat_database_tup_inserted{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "Inserts" ,
2025-08-13 17:09:45 +03:00
"range" : true ,
2025-10-15 11:20:49 +03:00
"refId" : "A"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"editorMode" : "code" ,
"expr" : "sum((delta(pg_stat_database_tup_updated{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "Updates" ,
"range" : true ,
"refId" : "B"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"editorMode" : "code" ,
"expr" : "sum((delta(pg_stat_database_tup_deleted{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "Deletes" ,
"range" : true ,
"refId" : "C"
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Tuples inserts/updates/deletes" ,
2025-08-13 17:09:45 +03: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" : [
{
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-12-05 11:12:21 +03:00
} ,
"unit" : "ms"
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
2025-10-15 11:20:49 +03:00
"h" : 7 ,
2025-08-13 17:09:45 +03:00
"w" : 12 ,
"x" : 12 ,
2025-10-15 11:20:49 +03:00
"y" : 81
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 29 ,
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" : [
{
2025-10-15 11:20:49 +03:00
"disableTextWrap" : false ,
2025-08-13 17:09:45 +03:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "pg_stat_activity_max_tx_duration{instance=\"$Instance\"}" ,
"fullMetaSearch" : false ,
"includeNullMetadata" : true ,
"legendFormat" : "{{instance}} / {{datname}} ({{state}})" ,
2025-08-13 17:09:45 +03:00
"range" : true ,
2025-10-15 11:20:49 +03:00
"refId" : "A" ,
"useBackend" : false
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Longest transition" ,
2025-08-13 17:09:45 +03:00
"type" : "timeseries"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"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 17:09:45 +03:00
"fieldConfig" : {
"defaults" : {
"color" : {
"mode" : "palette-classic"
} ,
"custom" : {
"axisBorderShow" : false ,
"axisCenteredZero" : false ,
"axisColorMode" : "text" ,
"axisLabel" : "" ,
"axisPlacement" : "auto" ,
"barAlignment" : 0 ,
"barWidthFactor" : 0.6 ,
"drawStyle" : "line" ,
2025-10-15 11:20:49 +03:00
"fillOpacity" : 10 ,
2025-08-13 17:09:45 +03:00
"gradientMode" : "none" ,
"hideFrom" : {
"legend" : false ,
"tooltip" : false ,
"viz" : false
} ,
"insertNulls" : false ,
"lineInterpolation" : "linear" ,
"lineWidth" : 1 ,
"pointSize" : 5 ,
"scaleDistribution" : {
"type" : "linear"
} ,
2025-10-15 11:20:49 +03:00
"showPoints" : "never" ,
2025-08-13 17:09:45 +03:00
"spanNulls" : false ,
"stacking" : {
"group" : "A" ,
"mode" : "none"
} ,
"thresholdsStyle" : {
"mode" : "off"
}
} ,
"mappings" : [ ] ,
2025-10-15 11:20:49 +03:00
"min" : 0 ,
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
} ,
{
"color" : "red" ,
"value" : 80
}
]
2025-10-15 11:20:49 +03:00
} ,
"unit" : "ms"
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
"h" : 8 ,
"w" : 12 ,
"x" : 0 ,
2025-10-15 11:20:49 +03:00
"y" : 88
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 25 ,
2025-08-13 17:09:45 +03:00
"options" : {
2025-10-15 11:20:49 +03:00
"dataLinks" : [ ] ,
2025-08-13 17:09:45 +03:00
"legend" : {
2025-10-15 11:20:49 +03:00
"calcs" : [
"mean" ,
"lastNotNull" ,
"max"
] ,
"displayMode" : "table" ,
2025-08-13 17:09:45 +03:00
"placement" : "bottom" ,
"showLegend" : true
} ,
"tooltip" : {
"hideZeros" : false ,
2025-10-15 11:20:49 +03:00
"mode" : "multi" ,
2025-08-13 17:09:45 +03:00
"sort" : "none"
}
} ,
2025-09-15 16:33:45 +03:00
"pluginVersion" : "12.1.0" ,
2025-08-13 17:09:45 +03:00
"targets" : [
{
2025-10-15 11:20:49 +03:00
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"expr" : "sum ((rate(pg_stat_database_blk_read_time{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "blk_read_time" ,
2025-08-13 17:09:45 +03:00
"refId" : "A"
2025-10-15 11:20:49 +03:00
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"expr" : "sum ((rate(pg_stat_database_blk_write_time{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "blk_read_time" ,
"refId" : "B"
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "I/O Read/Write time" ,
2025-08-13 17:09:45 +03:00
"type" : "timeseries"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"description" : "Source: pg_stat_database\n\n* tup_fetched: rows needed to satisfy queries\n* tup_returned: rows read/scanned" ,
2025-08-13 17:09:45 +03:00
"fieldConfig" : {
"defaults" : {
"color" : {
"mode" : "palette-classic"
} ,
"custom" : {
"axisBorderShow" : false ,
"axisCenteredZero" : false ,
"axisColorMode" : "text" ,
"axisLabel" : "" ,
"axisPlacement" : "auto" ,
"barAlignment" : 0 ,
"barWidthFactor" : 0.6 ,
"drawStyle" : "line" ,
2025-10-15 11:20:49 +03:00
"fillOpacity" : 10 ,
2025-08-13 17:09:45 +03:00
"gradientMode" : "none" ,
"hideFrom" : {
"legend" : false ,
"tooltip" : false ,
"viz" : false
} ,
"insertNulls" : false ,
"lineInterpolation" : "linear" ,
"lineWidth" : 1 ,
"pointSize" : 5 ,
"scaleDistribution" : {
"type" : "linear"
} ,
2025-10-15 11:20:49 +03:00
"showPoints" : "never" ,
2025-08-13 17:09:45 +03:00
"spanNulls" : false ,
"stacking" : {
"group" : "A" ,
"mode" : "none"
} ,
"thresholdsStyle" : {
"mode" : "off"
}
} ,
"mappings" : [ ] ,
2025-10-15 11:20:49 +03:00
"min" : 0 ,
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
} ,
{
"color" : "red" ,
"value" : 80
}
]
2025-10-15 11:20:49 +03:00
} ,
"unit" : "short"
2025-08-13 17:09:45 +03:00
} ,
"overrides" : [ ]
} ,
"gridPos" : {
"h" : 8 ,
"w" : 12 ,
"x" : 12 ,
2025-10-15 11:20:49 +03:00
"y" : 88
2025-08-13 17:09:45 +03:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 26 ,
2025-08-13 17:09:45 +03:00
"options" : {
2025-10-15 11:20:49 +03:00
"dataLinks" : [ ] ,
2025-08-13 17:09:45 +03:00
"legend" : {
2025-10-15 11:20:49 +03:00
"calcs" : [
"mean" ,
"lastNotNull" ,
"max"
] ,
"displayMode" : "table" ,
2025-08-13 17:09:45 +03:00
"placement" : "bottom" ,
"showLegend" : true
} ,
"tooltip" : {
"hideZeros" : false ,
2025-10-15 11:20:49 +03:00
"mode" : "multi" ,
2025-08-13 17:09:45 +03:00
"sort" : "none"
}
} ,
2025-09-15 16:33:45 +03:00
"pluginVersion" : "12.1.0" ,
2025-08-13 17:09:45 +03:00
"targets" : [
{
2025-10-15 11:20:49 +03:00
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-08-13 17:09:45 +03:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "sum((delta(pg_stat_database_tup_fetched{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "Fetched" ,
2025-08-13 17:09:45 +03:00
"range" : true ,
"refId" : "A"
2025-10-15 11:20:49 +03:00
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"editorMode" : "code" ,
"expr" : "sum((delta(pg_stat_database_tup_returned{instance=\"$Instance\"}[$__interval_ms])))" ,
"interval" : "" ,
"legendFormat" : "Returned" ,
"range" : true ,
"refId" : "B"
2025-08-13 17:09:45 +03:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Tuples fetched/returned" ,
2025-08-13 17:09:45 +03:00
"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-10-15 11:20:49 +03:00
"y" : 96
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-10-15 11:20:49 +03:00
"y" : 97
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-10-15 11:20:49 +03:00
"y" : 97
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-10-15 11:20:49 +03:00
"y" : 105
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-10-15 11:20:49 +03:00
"expr" : "delta(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-10-15 11:20:49 +03:00
"editorMode" : "code" ,
"expr" : "delta(pg_stat_database_xact_rollback{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])" ,
2025-08-15 10:11:45 +00:00
"hide" : false ,
"interval" : "" ,
"legendFormat" : "rollback" ,
2025-10-15 11:20:49 +03:00
"range" : true ,
2025-08-15 10:11:45 +00:00
"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-10-15 11:20:49 +03:00
"y" : 105
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-10-15 11:20:49 +03:00
"y" : 113
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-10-15 11:20:49 +03:00
"editorMode" : "code" ,
"expr" : "delta(pg_stat_database_tup_fetched{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])" ,
2025-08-15 10:11:45 +00:00
"interval" : "" ,
"legendFormat" : "Fetched" ,
2025-10-15 11:20:49 +03:00
"range" : true ,
2025-08-15 10:11:45 +00:00
"refId" : "A"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
2025-10-15 11:20:49 +03:00
"editorMode" : "code" ,
"expr" : "delta(pg_stat_database_tup_returned{instance=\"$Instance\",datname=\"$Database\"}[$__interval_ms])" ,
2025-08-15 10:11:45 +00:00
"interval" : "" ,
"legendFormat" : "Returned" ,
2025-10-15 11:20:49 +03:00
"range" : true ,
2025-08-15 10:11:45 +00:00
"refId" : "B"
}
] ,
"title" : "Tuples fetched/returned" ,
"type" : "timeseries"
} ,
{
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"fieldConfig" : {
"defaults" : {
2025-10-15 11:20:49 +03:00
"custom" : {
"align" : "auto" ,
"cellOptions" : {
"type" : "auto"
} ,
"inspect" : false
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"decimals" : 2 ,
"displayName" : "" ,
2025-08-15 10:11:45 +00:00
"mappings" : [ ] ,
2025-10-15 11:20:49 +03:00
"noValue" : "No most called queries" ,
2025-08-15 10:11:45 +00:00
"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
}
]
2025-10-15 11:20:49 +03:00
} ,
"unit" : "short"
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"overrides" : [
{
"matcher" : {
"id" : "byName" ,
"options" : "queryid"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Query ID"
} ,
{
"id" : "custom.align"
} ,
{
"id" : "unit"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "Time"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Time"
} ,
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "Value"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Calls/sec"
} ,
{
"id" : "unit" ,
"value" : "ops"
} ,
{
"id" : "custom.cellOptions" ,
"value" : {
"type" : "color-text"
}
} ,
{
"id" : "custom.align"
} ,
{
"id" : "thresholds" ,
"value" : {
"mode" : "absolute" ,
"steps" : [
{
"color" : "rgba(50, 172, 45, 0.97)" ,
"value" : 0
} ,
{
"color" : "rgba(237, 129, 40, 0.89)" ,
"value" : 100
} ,
{
"color" : "rgba(245, 54, 54, 0.9)" ,
"value" : 1000
} ,
{
"value" : 10000
}
]
}
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "job"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "tier"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "type"
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "query"
} ,
"properties" : [
{
"id" : "custom.width" ,
"value" : 217
}
]
}
]
2025-08-15 10:11:45 +00:00
} ,
"gridPos" : {
"h" : 8 ,
"w" : 12 ,
"x" : 12 ,
2025-10-15 11:20:49 +03:00
"y" : 113
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 46 ,
"links" : [
{
"url" : "/"
}
] ,
2025-08-15 10:11:45 +00:00
"options" : {
2025-10-15 11:20:49 +03:00
"cellHeight" : "sm" ,
"footer" : {
"countRows" : false ,
"fields" : "" ,
"reducer" : [
"sum"
] ,
"show" : false
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"showHeader" : true ,
"sortBy" : [
{
"desc" : true ,
"displayName" : "Query ID"
}
]
2025-08-15 10:11:45 +00:00
} ,
2025-09-15 16:33:45 +03:00
"pluginVersion" : "12.1.0" ,
2025-08-15 10:11:45 +00:00
"targets" : [
{
2025-10-15 11:20:49 +03:00
"datasource" : {
"type" : "prometheus" ,
"uid" : "prom"
} ,
"disableTextWrap" : false ,
"dsType" : "influxdb" ,
2025-08-15 10:11:45 +00:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "(\r\n sort_desc(\r\n topk(\r\n 10,\r\n rate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n )\r\n or irate(pg_stat_statements_calls_total{datname=~\"$Database\", instance=~\"$Instance\"}[$__interval_ms])\r\n)\r\n* on (queryid, instance)\r\ngroup_left(query)\r\nmax by (instance, queryid, query) (\r\n pg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)\r\n" ,
"format" : "table" ,
"fullMetaSearch" : false ,
"groupBy" : [
{
"params" : [
"$__interval"
] ,
"type" : "time"
} ,
{
"params" : [
"null"
] ,
"type" : "fill"
}
] ,
"hide" : false ,
"includeNullMetadata" : true ,
"instant" : true ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "" ,
"orderByTime" : "ASC" ,
"policy" : "default" ,
"refId" : "A" ,
"resultFormat" : "time_series" ,
"select" : [
[
{
"params" : [
"value"
] ,
"type" : "field"
} ,
{
"params" : [ ] ,
"type" : "mean"
}
]
] ,
"tags" : [ ] ,
"useBackend" : false
2025-08-15 10:11:45 +00:00
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "Most Called Queries" ,
"type" : "table"
2025-08-15 10:11:45 +00:00
} ,
{
"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-10-15 11:20:49 +03:00
"y" : 121
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" : {
"custom" : {
2025-10-15 11:20:49 +03:00
"align" : "auto" ,
"cellOptions" : {
"type" : "auto"
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"inspect" : false
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"decimals" : 2 ,
"displayName" : "" ,
2025-08-15 10:11:45 +00:00
"mappings" : [ ] ,
2025-10-15 11:20:49 +03:00
"noValue" : "No new slow queries" ,
2025-08-15 10:11:45 +00:00
"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
}
]
2025-10-15 11:20:49 +03:00
} ,
"unit" : "short"
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"overrides" : [
{
"matcher" : {
"id" : "byName" ,
"options" : "Time"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Time"
} ,
{
"id" : "custom.hidden" ,
"value" : true
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "queryid"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Query ID"
} ,
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.align"
} ,
{
"id" : "unit"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : ""
} ,
"properties" : [
{
"id" : "unit" ,
"value" : "short"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "Value"
} ,
"properties" : [
{
"id" : "displayName" ,
"value" : "Duration"
} ,
{
"id" : "unit" ,
"value" : "ms"
} ,
{
"id" : "decimals" ,
"value" : 2
} ,
{
"id" : "custom.align"
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "query"
} ,
"properties" : [
{
"id" : "custom.width" ,
"value" : 464
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "instance"
} ,
"properties" : [
{
"id" : "custom.width" ,
"value" : 61
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "datname"
} ,
"properties" : [
{
"id" : "custom.width" ,
"value" : 76
}
]
} ,
{
"matcher" : {
"id" : "byName" ,
"options" : "user"
} ,
"properties" : [
{
"id" : "custom.width" ,
"value" : 24
}
]
}
]
2025-08-15 10:11:45 +00:00
} ,
"gridPos" : {
"h" : 8 ,
"w" : 12 ,
"x" : 12 ,
2025-10-15 11:20:49 +03:00
"y" : 121
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"id" : 47 ,
2025-08-15 10:11:45 +00:00
"options" : {
2025-10-15 11:20:49 +03:00
"cellHeight" : "sm" ,
"footer" : {
"countRows" : false ,
"fields" : "" ,
"reducer" : [
"sum"
] ,
"show" : false
2025-08-15 10:11:45 +00:00
} ,
2025-10-15 11:20:49 +03:00
"showHeader" : true ,
"sortBy" : [ ]
2025-08-15 10:11:45 +00:00
} ,
2025-09-15 16:33:45 +03:00
"pluginVersion" : "12.1.0" ,
2025-08-15 10:11:45 +00:00
"targets" : [
{
2025-10-15 11:20:49 +03:00
"datasource" : {
"uid" : "Prometheus"
} ,
2025-08-15 10:11:45 +00:00
"disableTextWrap" : false ,
2025-10-15 11:20:49 +03:00
"dsType" : "influxdb" ,
2025-08-15 10:11:45 +00:00
"editorMode" : "code" ,
2025-10-15 11:20:49 +03:00
"expr" : "(\r\n sort_desc(\r\n topk(\r\n 5,\r\n sum by(queryid, datname, user) (\r\n irate(pg_stat_statements_seconds_total{instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n )\r\n )\r\n unless (\r\n topk(\r\n 20,\r\n sum by(queryid, datname, user) (\r\n irate(pg_stat_statements_time_milliseconds{instance=~\"$Instance\"}[$__interval_ms])\r\n )\r\n )\r\n )\r\n)\r\n* on (queryid)\r\ngroup_left(instance, query)\r\nmax by (instance, queryid, query) (\r\n pg_stat_statements_query_id{instance=~\"$Instance\"}\r\n)\r\n" ,
"format" : "table" ,
2025-08-15 10:11:45 +00:00
"fullMetaSearch" : false ,
2025-10-15 11:20:49 +03:00
"groupBy" : [
{
"params" : [
"$__interval"
] ,
"type" : "time"
} ,
{
"params" : [
"null"
] ,
"type" : "fill"
}
] ,
"hide" : false ,
2025-08-15 10:11:45 +00:00
"includeNullMetadata" : true ,
2025-10-15 11:20:49 +03:00
"instant" : false ,
"interval" : "$__interval_ms" ,
"intervalFactor" : 1 ,
"legendFormat" : "" ,
"orderByTime" : "ASC" ,
"policy" : "default" ,
2025-08-15 10:11:45 +00:00
"refId" : "A" ,
2025-10-15 11:20:49 +03:00
"resultFormat" : "time_series" ,
"select" : [
[
{
"params" : [
"value"
] ,
"type" : "field"
} ,
{
"params" : [ ] ,
"type" : "mean"
}
]
] ,
"tags" : [ ] ,
2025-08-15 10:11:45 +00:00
"useBackend" : false
}
] ,
2025-10-15 11:20:49 +03:00
"title" : "New Slow Queries for All Databases" ,
"type" : "table"
2025-08-15 10:11:45 +00:00
}
] ,
"preload" : false ,
"schemaVersion" : 41 ,
"tags" : [ ] ,
"templating" : {
"list" : [
{
"current" : {
2025-12-05 11:12:21 +03:00
"text" : "rc1b-flohldmalt9k1tth.mdb.yandexcloud.net:6432/db1" ,
"value" : "rc1b-flohldmalt9k1tth.mdb.yandexcloud.net:6432/db1"
2025-08-15 10:11:45 +00:00
} ,
"definition" : "label_values({job=\"integrations/postgres-exporter\"},instance)" ,
"description" : "" ,
2025-10-15 11:20:49 +03:00
"includeAll" : false ,
2025-08-15 10:11:45 +00:00
"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" ,
2025-10-15 11:20:49 +03:00
"value" : "$__all"
2025-08-15 10:11:45 +00:00
} ,
"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-10-15 11:26:12 +03:00
"title" : "PostgreSQL Exporter" ,
2025-10-15 11:20:49 +03:00
"uid" : "77ddcb0e-278f-4e0b-94e5-8b03b208d94d" ,
"version" : 3
2025-08-13 17:09:45 +03:00
}