Files
mtusi2026lab7/infra/otel/grafana/dashboards/lab7.json
T
2026-11-11 13:53:51 +03:00

485 lines
9.5 KiB
JSON

{
"uid": "lab7",
"title": "Lab7 \u2014 Messenger observations",
"schemaVersion": 39,
"version": 1,
"refresh": "5s",
"time": {
"from": "now-15m",
"to": "now"
},
"panels": [
{
"id": 1,
"type": "timeseries",
"title": "Business API requests / second",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(rate(app_http_requests_total[1m]))",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps"
},
"overrides": []
}
},
{
"id": 2,
"type": "timeseries",
"title": "API 5xx / business requests",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "slo:api_error_ratio:1m",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
},
"overrides": []
}
},
{
"id": 3,
"type": "timeseries",
"title": "API latency p50 / p95 / p99, all replicas",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.5,sum by(le)(rate(app_http_duration_seconds_bucket[1m])))",
"refId": "A"
},
{
"expr": "histogram_quantile(0.95,sum by(le)(rate(app_http_duration_seconds_bucket[1m])))",
"refId": "B"
},
{
"expr": "histogram_quantile(0.99,sum by(le)(rate(app_http_duration_seconds_bucket[1m])))",
"refId": "C"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 4,
"type": "timeseries",
"title": "Jobs processed / second by outcome",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum by(outcome)(rate(jobs_processed_total[1m]))",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops"
},
"overrides": []
}
},
{
"id": 5,
"type": "timeseries",
"title": "Worker processing p95",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.95,sum by(le)(rate(job_duration_seconds_bucket[1m])))",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 6,
"type": "timeseries",
"title": "Ready time p50 / p95 / p99",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.5,sum by(le)(rate(attachment_ready_seconds_bucket[2m])))",
"refId": "A"
},
{
"expr": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_seconds_bucket[2m])))",
"refId": "B"
},
{
"expr": "histogram_quantile(0.99,sum by(le)(rate(attachment_ready_seconds_bucket[2m])))",
"refId": "C"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 7,
"type": "timeseries",
"title": "Durable unfinished jobs",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "max(queue_depth)",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 8,
"type": "timeseries",
"title": "Oldest unfinished job / seconds",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "max(queue_oldest_age_seconds)",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 9,
"type": "timeseries",
"title": "DB pool used / waiting",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(db_pool_used)",
"refId": "A"
},
{
"expr": "sum(db_pool_waiting)",
"refId": "B"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 10,
"type": "timeseries",
"title": "Worker busy / capacity",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(worker_busy)",
"refId": "A"
},
{
"expr": "sum(worker_capacity)",
"refId": "B"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 11,
"type": "timeseries",
"title": "Process CPU / cores",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "rate(process_cpu_seconds[1m])",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 12,
"type": "timeseries",
"title": "Process RSS high water / bytes",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "process_memory_bytes",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
},
"overrides": []
}
},
{
"id": 13,
"type": "timeseries",
"title": "API budget burn / 30s / 2m / 5m",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "slo:api_error_ratio:30s / 0.01",
"refId": "A"
},
{
"expr": "slo:api_error_ratio:2m / 0.01",
"refId": "B"
},
{
"expr": "slo:api_error_ratio:5m / 0.01",
"refId": "C"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 14,
"type": "timeseries",
"title": "Active alerts",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "ALERTS{alertstate=\"firing\"}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 15,
"type": "timeseries",
"title": "Queue probe valid (0 = DB unavailable)",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 56,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "queue_probe_ok_ratio",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 16,
"type": "timeseries",
"title": "Collector failed exports / refused spans",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 56,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "rate(otelcol_exporter_send_failed_spans_total[1m])",
"refId": "A"
},
{
"expr": "rate(otelcol_receiver_refused_spans_total[1m])",
"refId": "B"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
}
],
"tags": [
"lab7"
]
}