Skip to content

Commit 7770522

Browse files
committed
fix: стабилизировать stat-панели security метрик в Grafana
Что сделано: - для панелей 401/403/429 включен instant-режим запросов - добавлено округление и noValue=0 для стабильного отображения значений - отключен range-режим для stat-панелей, чтобы не получать пустые значения - увеличена версия дашборда для корректного обновления provisioning
1 parent 9f7c3bf commit 7770522

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

monitoring/grafana/provisioning/dashboards/json/task-manager-observability.json

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,9 @@
863863
}
864864
]
865865
},
866-
"unit": "short"
866+
"unit": "short",
867+
"decimals": 0,
868+
"noValue": "0"
867869
},
868870
"overrides": []
869871
},
@@ -891,10 +893,11 @@
891893
"targets": [
892894
{
893895
"editorMode": "code",
894-
"expr": "sum(increase(http_requests_total{status=\"401\", method=~\"$method\", path=~\"$path\"}[5m])) or vector(0)",
896+
"expr": "round(sum(increase(http_requests_total{status=\"401\", method=~\"$method\", path=~\"$path\"}[5m])) or vector(0))",
895897
"legendFormat": "",
896-
"range": true,
897-
"refId": "A"
898+
"range": false,
899+
"refId": "A",
900+
"instant": true
898901
}
899902
],
900903
"title": "401 за 5 минут",
@@ -928,7 +931,9 @@
928931
}
929932
]
930933
},
931-
"unit": "short"
934+
"unit": "short",
935+
"decimals": 0,
936+
"noValue": "0"
932937
},
933938
"overrides": []
934939
},
@@ -956,10 +961,11 @@
956961
"targets": [
957962
{
958963
"editorMode": "code",
959-
"expr": "sum(increase(http_requests_total{status=\"403\", method=~\"$method\", path=~\"$path\"}[5m])) or vector(0)",
964+
"expr": "round(sum(increase(http_requests_total{status=\"403\", method=~\"$method\", path=~\"$path\"}[5m])) or vector(0))",
960965
"legendFormat": "",
961-
"range": true,
962-
"refId": "A"
966+
"range": false,
967+
"refId": "A",
968+
"instant": true
963969
}
964970
],
965971
"title": "403 за 5 минут",
@@ -993,7 +999,9 @@
993999
}
9941000
]
9951001
},
996-
"unit": "short"
1002+
"unit": "short",
1003+
"decimals": 0,
1004+
"noValue": "0"
9971005
},
9981006
"overrides": []
9991007
},
@@ -1021,10 +1029,11 @@
10211029
"targets": [
10221030
{
10231031
"editorMode": "code",
1024-
"expr": "sum(increase(http_requests_total{status=\"429\", method=~\"$method\", path=~\"$path\"}[5m])) or vector(0)",
1032+
"expr": "round(sum(increase(http_requests_total{status=\"429\", method=~\"$method\", path=~\"$path\"}[5m])) or vector(0))",
10251033
"legendFormat": "",
1026-
"range": true,
1027-
"refId": "A"
1034+
"range": false,
1035+
"refId": "A",
1036+
"instant": true
10281037
}
10291038
],
10301039
"title": "429 за 5 минут",
@@ -1106,6 +1115,6 @@
11061115
"timezone": "",
11071116
"title": "Task Manager API - Observability",
11081117
"uid": "task-manager-observability",
1109-
"version": 2,
1118+
"version": 3,
11101119
"weekStart": ""
11111120
}

0 commit comments

Comments
 (0)