Skip to content

Commit 830d022

Browse files
committed
Fix conflict/deadlock metrics
These metrics are gauges, so applying rate is not required Signed-off-by: Vitaly Zhuravlev <[email protected]>
1 parent e3349c0 commit 830d022

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

postgres_mixin/dashboards/postgres-overview.json

+21-4
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,23 @@
941941
},
942942
"unit": "short"
943943
},
944-
"overrides": []
944+
"overrides": [
945+
{
946+
"matcher": {
947+
"id": "byName",
948+
"options": "deadlocks"
949+
},
950+
"properties": [
951+
{
952+
"id": "color",
953+
"value": {
954+
"fixedColor": "light-red",
955+
"mode": "fixed"
956+
}
957+
}
958+
]
959+
}
960+
]
945961
},
946962
"gridPos": {
947963
"h": 7,
@@ -971,7 +987,7 @@
971987
"uid": "$datasource"
972988
},
973989
"dsType": "prometheus",
974-
"expr": "sum(rate(pg_stat_database_deadlocks{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval]))",
990+
"expr": "sum(pg_stat_database_deadlocks{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"})",
975991
"format": "time_series",
976992
"groupBy": [
977993
{
@@ -991,6 +1007,7 @@
9911007
"legendFormat": "deadlocks",
9921008
"measurement": "postgresql",
9931009
"policy": "default",
1010+
"range": true,
9941011
"refId": "A",
9951012
"resultFormat": "time_series",
9961013
"select": [
@@ -1027,7 +1044,7 @@
10271044
},
10281045
"dsType": "prometheus",
10291046
"editorMode": "code",
1030-
"expr": "sum(rate(pg_stat_database_conflicts{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval]))",
1047+
"expr": "sum(pg_stat_database_conflicts{datname=~\"$db\",job=~\"$job\",instance=~\"$instance\"})",
10311048
"format": "time_series",
10321049
"groupBy": [
10331050
{
@@ -1386,7 +1403,7 @@
13861403
]
13871404
},
13881405
"time": {
1389-
"from": "now-3h",
1406+
"from": "now-1h",
13901407
"to": "now"
13911408
},
13921409
"timepicker": {

0 commit comments

Comments
 (0)