forked from mtusi2026/mtusi2026lab6
391 lines
11 KiB
JSON
391 lines
11 KiB
JSON
{
|
|
"annotations": {
|
|
"list": [
|
|
{
|
|
"builtIn": 1,
|
|
"datasource": {
|
|
"type": "grafana",
|
|
"uid": "-- Grafana --"
|
|
},
|
|
"enable": true,
|
|
"hide": true,
|
|
"name": "Annotations & Alerts",
|
|
"type": "dashboard"
|
|
}
|
|
]
|
|
},
|
|
"editable": true,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": 1,
|
|
"id": null,
|
|
"links": [],
|
|
"liveNow": false,
|
|
"panels": [
|
|
{
|
|
"collapsed": false,
|
|
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
|
|
"id": 100,
|
|
"title": "API Metrics",
|
|
"type": "row"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "smooth"
|
|
},
|
|
"unit": "reqps"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 1 },
|
|
"id": 1,
|
|
"options": {
|
|
"legend": { "displayMode": "table", "placement": "bottom" },
|
|
"tooltip": { "mode": "multi" }
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "sum(rate(messenger_http_requests_total[1m])) by (route, status)",
|
|
"legendFormat": "{{route}} - {{status}}",
|
|
"range": true,
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "HTTP Request Rate (RPS)",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "smooth"
|
|
},
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 1 },
|
|
"id": 2,
|
|
"options": {
|
|
"legend": { "displayMode": "table", "placement": "bottom" },
|
|
"tooltip": { "mode": "multi" }
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_http_request_duration_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p50",
|
|
"range": true,
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_http_request_duration_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p95",
|
|
"range": true,
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.99, sum(rate(messenger_http_request_duration_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p99",
|
|
"range": true,
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"title": "HTTP Latency Quantiles",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": { "mode": "thresholds" },
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{ "color": "green", "value": null },
|
|
{ "color": "yellow", "value": 0.01 },
|
|
{ "color": "red", "value": 0.05 }
|
|
]
|
|
},
|
|
"unit": "percentunit"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 6, "w": 8, "x": 0, "y": 9 },
|
|
"id": 3,
|
|
"options": {
|
|
"orientation": "auto",
|
|
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
|
|
"showThresholdLabels": false,
|
|
"showThresholdMarkers": true
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "(sum(rate(messenger_http_requests_total{status=~\"5..\"}[1m])) or vector(0)) / (sum(rate(messenger_http_requests_total[1m])) > 0 or vector(1))",
|
|
"legendFormat": "5xx Ratio",
|
|
"range": true,
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "HTTP 5xx Error Ratio",
|
|
"type": "gauge"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "stepAfter"
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 6, "w": 8, "x": 8, "y": 9 },
|
|
"id": 4,
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "messenger_queue_depth",
|
|
"legendFormat": "Queue Depth",
|
|
"range": true,
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "RabbitMQ Queue Depth",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "linear"
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 6, "w": 8, "x": 16, "y": 9 },
|
|
"id": 5,
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "messenger_db_pool_connections",
|
|
"legendFormat": "DB Active Pool",
|
|
"range": true,
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "PostgreSQL Active Connections",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"collapsed": false,
|
|
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 15 },
|
|
"id": 101,
|
|
"title": "Worker Metrics",
|
|
"type": "row"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "smooth"
|
|
},
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 },
|
|
"id": 6,
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_job_processing_duration_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p50",
|
|
"range": true,
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_job_processing_duration_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p95",
|
|
"range": true,
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"title": "Worker Job Processing Latency",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "smooth"
|
|
},
|
|
"unit": "ops"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 16 },
|
|
"id": 7,
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "sum(rate(messenger_jobs_processed_total[1m]))",
|
|
"legendFormat": "Processed rate",
|
|
"range": true,
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "sum(rate(messenger_jobs_failed_total[1m]))",
|
|
"legendFormat": "Failed rate",
|
|
"range": true,
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"title": "Worker Jobs Throughput & Failures",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "smooth"
|
|
},
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 6, "w": 12, "x": 0, "y": 24 },
|
|
"id": 9,
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "messenger_queue_oldest_job_age_seconds",
|
|
"legendFormat": "Oldest Job Age",
|
|
"range": true,
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "Oldest Waiting Job Age",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"lineInterpolation": "smooth"
|
|
},
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 6, "w": 12, "x": 12, "y": 24 },
|
|
"id": 10,
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_attachment_time_to_ready_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p95 Time-to-Ready",
|
|
"range": true,
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"editorMode": "code",
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_attachment_time_to_ready_seconds_bucket[1m])) by (le))",
|
|
"legendFormat": "p50 Time-to-Ready",
|
|
"range": true,
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"title": "Attachment End-to-End Time to Ready",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"collapsed": false,
|
|
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 30 },
|
|
"id": 102,
|
|
"title": "Logs & Tracing",
|
|
"type": "row"
|
|
},
|
|
{
|
|
"datasource": { "type": "loki", "uid": "loki" },
|
|
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 31 },
|
|
"id": 8,
|
|
"options": {
|
|
"dedupStrategy": "none",
|
|
"enableLogDetails": true,
|
|
"prettifyLogMessage": false,
|
|
"showCommonLabels": false,
|
|
"showLabels": false,
|
|
"showTime": true,
|
|
"sortOrder": "Descending",
|
|
"wrapLogMessage": true
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": { "type": "loki", "uid": "loki" },
|
|
"editorMode": "code",
|
|
"expr": "{service_name=~\".+\"}",
|
|
"queryType": "range",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "Live Application Logs (Loki)",
|
|
"type": "logs"
|
|
}
|
|
],
|
|
"refresh": "5s",
|
|
"schemaVersion": 38,
|
|
"style": "dark",
|
|
"tags": ["lab6", "messenger", "observability"],
|
|
"time": {
|
|
"from": "now-15m",
|
|
"to": "now"
|
|
},
|
|
"timepicker": {
|
|
"refresh_intervals": ["5s", "10s", "30s", "1m"]
|
|
},
|
|
"timezone": "browser",
|
|
"title": "Messenger System Overview",
|
|
"uid": "messenger-overview",
|
|
"version": 1
|
|
}
|