forked from mtusi2026/mtusi2026lab7
327 lines
6.9 KiB
JSON
327 lines
6.9 KiB
JSON
{
|
|
"uid": "messenger-lab6",
|
|
"title": "Messenger — Lab 6",
|
|
"schemaVersion": 39,
|
|
"version": 1,
|
|
"editable": true,
|
|
"refresh": "5s",
|
|
"time": {
|
|
"from": "now-15m",
|
|
"to": "now"
|
|
},
|
|
"tags": [
|
|
"lab6",
|
|
"otel"
|
|
],
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"name": "trace_id",
|
|
"label": "X-Trace-Id",
|
|
"type": "textbox",
|
|
"current": {
|
|
"text": "",
|
|
"value": ""
|
|
},
|
|
"options": []
|
|
}
|
|
]
|
|
},
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"title": "API — RPS (без health)",
|
|
"type": "timeseries",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum(rate(messenger_http_requests_total{service_name=\"messenger-api\"}[1m]))",
|
|
"legendFormat": ""
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 2,
|
|
"title": "API — 5xx / все запросы",
|
|
"type": "timeseries",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 0,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "(sum(rate(messenger_http_requests_total{service_name=\"messenger-api\",status_class=\"5xx\"}[1m])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total{service_name=\"messenger-api\"}[1m])), 0.000001)",
|
|
"legendFormat": ""
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "API — p95 по всем репликам",
|
|
"type": "timeseries",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 8,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_http_duration_seconds_bucket{service_name=\"messenger-api\"}[2m])))",
|
|
"legendFormat": ""
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 4,
|
|
"title": "API — RPS по route / status",
|
|
"type": "timeseries",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 8,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum by (route,status_class) (rate(messenger_http_requests_total{service_name=\"messenger-api\"}[1m]))",
|
|
"legendFormat": "{{route}} {{status_class}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"title": "Worker — успешные / ошибочные / пропущенные доставки",
|
|
"type": "timeseries",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 16,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum by (outcome) (increase(messenger_jobs_total{service_name=\"messenger-worker\"}[5m]))",
|
|
"legendFormat": "{{outcome}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"title": "Worker — p95 processing duration",
|
|
"type": "timeseries",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 16,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "histogram_quantile(0.95, sum by (le,outcome) (rate(messenger_job_duration_seconds_bucket{service_name=\"messenger-worker\"}[5m])))",
|
|
"legendFormat": "{{outcome}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"title": "API — структурные логи",
|
|
"type": "logs",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "loki"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 24,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "{service_name=\"messenger-api\"}",
|
|
"legendFormat": ""
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": ""
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"showTime": true,
|
|
"showLabels": false,
|
|
"wrapLogMessage": true,
|
|
"sortOrder": "Descending"
|
|
}
|
|
},
|
|
{
|
|
"id": 8,
|
|
"title": "Worker — структурные логи",
|
|
"type": "logs",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "loki"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 24,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "{service_name=\"messenger-worker\"}",
|
|
"legendFormat": ""
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": ""
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"showTime": true,
|
|
"showLabels": false,
|
|
"wrapLogMessage": true,
|
|
"sortOrder": "Descending"
|
|
}
|
|
},
|
|
{
|
|
"id": 9,
|
|
"title": "Трасса по X-Trace-Id",
|
|
"type": "traces",
|
|
"datasource": {
|
|
"type": "tempo",
|
|
"uid": "tempo"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 32,
|
|
"w": 24,
|
|
"h": 10
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"queryType": "traceId",
|
|
"query": "${trace_id}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|