Files
mtusi2026lab6/infra/grafana/dashboards/messenger.json
T
2026-11-18 21:37:25 +03:00

520 lines
11 KiB
JSON

{
"uid": "messenger",
"title": "Messenger observability",
"schemaVersion": 41,
"version": 1,
"refresh": "5s",
"time": {
"from": "now-15m",
"to": "now"
},
"panels": [
{
"id": 1,
"title": "API RPS (business routes)",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(rate(messenger_http_requests_total[$__rate_interval])) by (route)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 2,
"title": "API 5xx / all business requests",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "(sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[$__rate_interval])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[$__rate_interval])),0.001)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 3,
"title": "API p50 / p95 / p99 (all replicas, histogram)",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.5,sum(rate(messenger_http_duration_seconds_bucket[$__rate_interval])) by(le))",
"legendFormat": "p50",
"refId": "A"
},
{
"expr": "histogram_quantile(0.95,sum(rate(messenger_http_duration_seconds_bucket[$__rate_interval])) by(le))",
"legendFormat": "p95",
"refId": "B"
},
{
"expr": "histogram_quantile(0.99,sum(rate(messenger_http_duration_seconds_bucket[$__rate_interval])) by(le))",
"legendFormat": "p99",
"refId": "C"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 4,
"title": "Worker job outcomes per second",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(rate(messenger_jobs_total[$__rate_interval])) by(outcome)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 5,
"title": "Worker job p95 duration",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.95,sum(rate(messenger_job_duration_seconds_bucket[$__rate_interval])) by(le,outcome))",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 6,
"title": "Time from durable acceptance to ready p95",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.95,sum(rate(messenger_attachment_ready_seconds_bucket[$__rate_interval])) by(le))",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 7,
"title": "Authoritative queue depth (max across observers)",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "max(messenger_queue_depth)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 8,
"title": "Oldest unfinished job age",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "max(messenger_queue_oldest_age_seconds)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 9,
"title": "DB pool acquired / acquiring / max",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "messenger_db_pool_used",
"legendFormat": "used {{service_name}} {{service_instance_id}}",
"refId": "A"
},
{
"expr": "messenger_db_pool_waiting",
"legendFormat": "waiting {{service_name}} {{service_instance_id}}",
"refId": "B"
},
{
"expr": "messenger_db_pool_max",
"legendFormat": "max {{service_name}} {{service_instance_id}}",
"refId": "C"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 10,
"title": "Worker saturation busy / capacity",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(messenger_worker_busy{service_name=\"messenger-worker\"}) / clamp_min(sum(messenger_worker_capacity{service_name=\"messenger-worker\"}),1)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 11,
"title": "Go runtime reserved memory (MemStats.Sys)",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "messenger_process_memory_bytes",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 12,
"title": "Process CPU seconds / second",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "rate(messenger_process_cpu_seconds_total[$__rate_interval])",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 13,
"title": "SDK failed telemetry export operations",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "messenger_telemetry_export_errors",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 14,
"title": "Exporter failed spans (attempts, not unique loss)",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(otelcol_exporter_send_failed_spans_total) by (exporter)",
"legendFormat": "{{service_name}} {{outcome}} {{route}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
}
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 99,
"title": "API and worker structured logs; trace ID opens Tempo",
"type": "logs",
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"x": 0,
"y": 56,
"w": 24,
"h": 10
},
"targets": [
{
"expr": "{service_name=~\"messenger-api|messenger-worker\"} | json",
"refId": "A"
}
]
}
],
"annotations": {
"list": []
}
}