forked from mtusi2026/mtusi2026lab7
486 lines
11 KiB
JSON
486 lines
11 KiB
JSON
{
|
|
"uid": "messenger-observability",
|
|
"title": "Messenger — Observability",
|
|
"schemaVersion": 40,
|
|
"version": 1,
|
|
"refresh": "5s",
|
|
"time": {
|
|
"from": "now-15m",
|
|
"to": "now"
|
|
},
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"title": "API RPS (business requests)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum by(http_route)(rate(http_server_requests_total[$__rate_interval]))",
|
|
"legendFormat": "{{http_route}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 2,
|
|
"title": "API p50 / p95 / p99 (all replicas)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 0,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "histogram_quantile(0.5, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p50"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"expr": "histogram_quantile(0.95, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p95"
|
|
},
|
|
{
|
|
"refId": "C",
|
|
"expr": "histogram_quantile(0.99, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p99"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "API error rate (5xx / all business requests)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 8,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "(sum(rate(http_server_requests_total{http_response_status_class=\"5xx\"}[$__rate_interval])) or vector(0)) / clamp_min(sum(rate(http_server_requests_total[$__rate_interval])),0.001)",
|
|
"legendFormat": "5xx ratio"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 4,
|
|
"title": "Queue depth (durable outstanding jobs)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 8,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "max(queue_depth)",
|
|
"legendFormat": "jobs"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"title": "Oldest outstanding job / observation age",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 16,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "max(queue_oldest_age)",
|
|
"legendFormat": "oldest"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"expr": "time()-max(queue_observation_timestamp)",
|
|
"legendFormat": "observation age"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"title": "Worker saturation (busy / capacity)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 16,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum(worker_busy) / clamp_min(sum(worker_capacity),1)",
|
|
"legendFormat": "saturation"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"title": "Worker outcomes per second",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 24,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum by(outcome)(rate(worker_jobs_total[$__rate_interval]))",
|
|
"legendFormat": "{{outcome}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "ops"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 8,
|
|
"title": "Worker p50 / p95 / p99",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 24,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "histogram_quantile(0.5,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p50"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"expr": "histogram_quantile(0.95,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p95"
|
|
},
|
|
{
|
|
"refId": "C",
|
|
"expr": "histogram_quantile(0.99,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p99"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 9,
|
|
"title": "DB pools (application + outbox)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 32,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum(db_pool_used)",
|
|
"legendFormat": "used"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"expr": "sum(db_pool_waiting)",
|
|
"legendFormat": "waiting"
|
|
},
|
|
{
|
|
"refId": "C",
|
|
"expr": "sum(db_pool_capacity)",
|
|
"legendFormat": "capacity"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 10,
|
|
"title": "Acceptance to ready p50 / p95 / p99",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 32,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "histogram_quantile(0.5,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p50"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"expr": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p95"
|
|
},
|
|
{
|
|
"refId": "C",
|
|
"expr": "histogram_quantile(0.99,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
|
"legendFormat": "p99"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 11,
|
|
"title": "Process resident memory",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 40,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "process_memory_usage",
|
|
"legendFormat": "{{service_name}} / {{service_instance_id}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "bytes"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 12,
|
|
"title": "Process CPU (cores)",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 40,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "rate(process_cpu_time[$__rate_interval])",
|
|
"legendFormat": "{{service_name}} / {{service_instance_id}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 13,
|
|
"title": "Collector rejected/failed signal export",
|
|
"type": "timeseries",
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 48,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "prometheus"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum(rate(otelcol_exporter_send_failed_spans[$__rate_interval]))",
|
|
"legendFormat": "exporter_send_failed_spans"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"expr": "sum(rate(otelcol_exporter_send_failed_log_records[$__rate_interval]))",
|
|
"legendFormat": "exporter_send_failed_log_records"
|
|
},
|
|
{
|
|
"refId": "C",
|
|
"expr": "sum(rate(otelcol_processor_refused_spans[$__rate_interval]))",
|
|
"legendFormat": "processor_refused_spans"
|
|
},
|
|
{
|
|
"refId": "D",
|
|
"expr": "sum(rate(otelcol_exporter_enqueue_failed_spans[$__rate_interval]))",
|
|
"legendFormat": "exporter_enqueue_failed_spans"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": 14,
|
|
"title": "Correlated application events",
|
|
"type": "logs",
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 48,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "loki"
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "{service_name=~\"messenger-api|messenger-worker\"}",
|
|
"legendFormat": "logs"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {}
|
|
}
|
|
],
|
|
"tags": [
|
|
"lab6"
|
|
],
|
|
"annotations": {
|
|
"list": []
|
|
}
|
|
}
|