feat: метрики использования каждой NER-модели и панели дашборда

- Добавлены счётчики pdguard.ner.model.requests и таймеры
  pdguard.ner.model.duration с тегом model (name/address/legal).
- Гистограммы для таймеров моделей включены в MetricsConfiguration.
- Дашборд дополнен панелями «Обращения к моделям» и «Время моделей».
- Prometheus собирает метрики с обеих нод кластера.
- Целевые значения лимитера: min-concurrent 100, target-latency 900.
- Подавление S2925 (Thread.sleep) в тесте лимитера.
This commit is contained in:
dakocha3
2026-09-23 23:51:07 +03:00
parent 7a388e3d4a
commit ddceca076c
6 changed files with 192 additions and 17 deletions
+140 -10
View File
@@ -2149,6 +2149,136 @@
}
}
},
{
"type": "timeseries",
"title": "Обращения к моделям",
"id": 49,
"datasource": {
"type": "prometheus",
"uid": "PDGUARD_PROM"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 74
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PDGUARD_PROM"
},
"expr": "sum by (model) (rate(pdguard_ner_model_requests_total[$__rate_interval]))",
"refId": "A",
"instant": false,
"legendFormat": "{{model}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"custom": {
"fillOpacity": 45,
"lineWidth": 2,
"showPoints": "never",
"stacking": {
"mode": "normal"
}
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "text",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"mean",
"max"
],
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"title": "Время моделей",
"id": 50,
"datasource": {
"type": "prometheus",
"uid": "PDGUARD_PROM"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 74
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PDGUARD_PROM"
},
"expr": "histogram_quantile(0.95, sum by (le, model) (rate(pdguard_ner_model_duration_seconds_bucket[$__rate_interval])))",
"refId": "A",
"instant": false,
"legendFormat": "{{model}} p95"
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"fillOpacity": 12,
"lineWidth": 2,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "text",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"mean",
"max"
],
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "row",
"title": "Ресурсы узла",
@@ -2157,7 +2287,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 74
"y": 90
},
"collapsed": false
},
@@ -2173,7 +2303,7 @@
"h": 5,
"w": 4,
"x": 0,
"y": 75
"y": 91
},
"targets": [
{
@@ -2236,7 +2366,7 @@
"h": 5,
"w": 4,
"x": 4,
"y": 75
"y": 91
},
"targets": [
{
@@ -2291,7 +2421,7 @@
"h": 5,
"w": 4,
"x": 8,
"y": 75
"y": 91
},
"targets": [
{
@@ -2346,7 +2476,7 @@
"h": 5,
"w": 4,
"x": 12,
"y": 75
"y": 91
},
"targets": [
{
@@ -2409,7 +2539,7 @@
"h": 5,
"w": 4,
"x": 16,
"y": 75
"y": 91
},
"targets": [
{
@@ -2464,7 +2594,7 @@
"h": 5,
"w": 4,
"x": 20,
"y": 75
"y": 91
},
"targets": [
{
@@ -2523,7 +2653,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 80
"y": 96
},
"targets": [
{
@@ -2588,7 +2718,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 80
"y": 96
},
"targets": [
{
@@ -2643,4 +2773,4 @@
}
}
]
}
}