177 lines
3.7 KiB
JSON
177 lines
3.7 KiB
JSON
{
|
||
"title": "ЛР6 · Messenger",
|
||
"uid": "lab6-messenger",
|
||
"schemaVersion": 39,
|
||
"version": 1,
|
||
"editable": false,
|
||
"time": {
|
||
"from": "now-15m",
|
||
"to": "now"
|
||
},
|
||
"refresh": "10s",
|
||
"timezone": "browser",
|
||
"panels": [
|
||
{
|
||
"id": 1,
|
||
"title": "API · запросы/с",
|
||
"type": "timeseries",
|
||
"gridPos": {
|
||
"x": 0,
|
||
"y": 0,
|
||
"w": 12,
|
||
"h": 8
|
||
},
|
||
"datasource": {
|
||
"type": "prometheus",
|
||
"uid": "lab6-prometheus"
|
||
},
|
||
"fieldConfig": {
|
||
"defaults": {
|
||
"unit": "reqps"
|
||
},
|
||
"overrides": []
|
||
},
|
||
"targets": [
|
||
{
|
||
"refId": "A",
|
||
"expr": "sum by (method, route) (rate(messenger_http_requests_total{route!~\"/health/.*\"}[1m]))"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"id": 2,
|
||
"title": "API · 4xx и 5xx/с",
|
||
"type": "timeseries",
|
||
"gridPos": {
|
||
"x": 12,
|
||
"y": 0,
|
||
"w": 12,
|
||
"h": 8
|
||
},
|
||
"datasource": {
|
||
"type": "prometheus",
|
||
"uid": "lab6-prometheus"
|
||
},
|
||
"fieldConfig": {
|
||
"defaults": {
|
||
"unit": "reqps"
|
||
},
|
||
"overrides": []
|
||
},
|
||
"targets": [
|
||
{
|
||
"refId": "A",
|
||
"expr": "sum by (status_class) (rate(messenger_http_requests_total{status_class=~\"4xx|5xx\",route!~\"/health/.*\"}[1m]))"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"id": 3,
|
||
"title": "API · средняя длительность",
|
||
"type": "timeseries",
|
||
"gridPos": {
|
||
"x": 0,
|
||
"y": 8,
|
||
"w": 12,
|
||
"h": 8
|
||
},
|
||
"datasource": {
|
||
"type": "prometheus",
|
||
"uid": "lab6-prometheus"
|
||
},
|
||
"fieldConfig": {
|
||
"defaults": {
|
||
"unit": "s"
|
||
},
|
||
"overrides": []
|
||
},
|
||
"targets": [
|
||
{
|
||
"refId": "A",
|
||
"expr": "sum(rate(messenger_http_duration_seconds_sum{route!~\"/health/.*\"}[1m])) / sum(rate(messenger_http_duration_seconds_count{route!~\"/health/.*\"}[1m]))"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"id": 4,
|
||
"title": "Worker · успешные и неуспешные задания",
|
||
"type": "timeseries",
|
||
"gridPos": {
|
||
"x": 12,
|
||
"y": 8,
|
||
"w": 12,
|
||
"h": 8
|
||
},
|
||
"datasource": {
|
||
"type": "prometheus",
|
||
"uid": "lab6-prometheus"
|
||
},
|
||
"fieldConfig": {
|
||
"defaults": {
|
||
"unit": "short"
|
||
},
|
||
"overrides": []
|
||
},
|
||
"targets": [
|
||
{
|
||
"refId": "A",
|
||
"expr": "sum by (outcome) (messenger_job_outcomes_total)"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"id": 5,
|
||
"title": "Worker · средняя длительность",
|
||
"type": "timeseries",
|
||
"gridPos": {
|
||
"x": 0,
|
||
"y": 16,
|
||
"w": 12,
|
||
"h": 8
|
||
},
|
||
"datasource": {
|
||
"type": "prometheus",
|
||
"uid": "lab6-prometheus"
|
||
},
|
||
"fieldConfig": {
|
||
"defaults": {
|
||
"unit": "s"
|
||
},
|
||
"overrides": []
|
||
},
|
||
"targets": [
|
||
{
|
||
"refId": "A",
|
||
"expr": "sum by (outcome) (messenger_job_duration_seconds_sum) / sum by (outcome) (messenger_job_duration_seconds_count)"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"id": 6,
|
||
"title": "События API и worker",
|
||
"type": "logs",
|
||
"gridPos": {
|
||
"x": 0,
|
||
"y": 24,
|
||
"w": 24,
|
||
"h": 10
|
||
},
|
||
"datasource": {
|
||
"type": "loki",
|
||
"uid": "lab6-loki"
|
||
},
|
||
"targets": [
|
||
{
|
||
"refId": "A",
|
||
"expr": "{service_name=~\"messenger-api|messenger-worker\"} | event != \"\"",
|
||
"queryType": "range"
|
||
}
|
||
],
|
||
"options": {
|
||
"showTime": true,
|
||
"enableLogDetails": true
|
||
}
|
||
}
|
||
]
|
||
}
|