forked from mtusi2026/mtusi2026lab7
142 lines
7.5 KiB
JSON
142 lines
7.5 KiB
JSON
{
|
|
"annotations": {"list": []},
|
|
"editable": false,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": 1,
|
|
"id": null,
|
|
"links": [],
|
|
"liveNow": false,
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"title": "API requests / second",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [{"refId": "A", "expr": "sum by (http_request_method) (rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\",http_route!~\"/health/.*\"}[5m]))", "legendFormat": "{{http_request_method}}"}],
|
|
"fieldConfig": {"defaults": {"unit": "reqps"}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 0, "y": 0}
|
|
},
|
|
{
|
|
"id": 2,
|
|
"title": "API 5xx ratio",
|
|
"description": "5xx business responses divided by all business responses over 5 minutes; health routes are excluded. Displayed as percent (0..100%).",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [{"refId": "A", "expr": "(sum(rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\",http_response_status_code=~\"5..\",http_route!~\"/health/.*\"}[5m])) or vector(0)) / clamp_min(sum(rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\",http_route!~\"/health/.*\"}[5m])), 0.001)", "legendFormat": "5xx / all"}],
|
|
"fieldConfig": {"defaults": {"unit": "percentunit", "min": 0, "max": 1}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 8, "y": 0}
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "API duration p50 / p95 / p99",
|
|
"description": "Seconds. histogram_quantile is calculated from the summed Prometheus histogram buckets of all API replicas; replica percentiles are never averaged.",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [
|
|
{"refId": "A", "expr": "histogram_quantile(0.50, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\",http_route!~\"/health/.*\"}[5m])))", "legendFormat": "p50"},
|
|
{"refId": "B", "expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\",http_route!~\"/health/.*\"}[5m])))", "legendFormat": "p95"},
|
|
{"refId": "C", "expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\",http_route!~\"/health/.*\"}[5m])))", "legendFormat": "p99"}
|
|
],
|
|
"fieldConfig": {"defaults": {"unit": "s"}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 16, "y": 0}
|
|
},
|
|
{
|
|
"id": 4,
|
|
"title": "Job outcomes / second",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [{"refId": "A", "expr": "sum by (outcome) (rate(messenger_jobs_processed_total{service_name=\"messenger-worker\"}[5m]))", "legendFormat": "{{outcome}}"}],
|
|
"fieldConfig": {"defaults": {"unit": "ops"}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 0, "y": 8}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"title": "Job duration p95",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [{"refId": "A", "expr": "histogram_quantile(0.95, sum by (le, outcome) (rate(messenger_job_processing_duration_seconds_bucket{service_name=\"messenger-worker\"}[5m])))", "legendFormat": "{{outcome}}"}],
|
|
"fieldConfig": {"defaults": {"unit": "s"}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 8, "y": 8}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"title": "Time to ready p95",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [{"refId": "A", "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket{service_name=\"messenger-worker\"}[10m])))", "legendFormat": "p95"}],
|
|
"fieldConfig": {"defaults": {"unit": "s"}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 16, "y": 8}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"title": "Queue depth and oldest age",
|
|
"description": "Left axis: durable queued jobs (count). Right axis: age of the oldest unfinished job (seconds). Backlog age is not processing latency.",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [
|
|
{"refId": "A", "expr": "max(messenger_queue_depth{service_name=\"messenger-api\"})", "legendFormat": "depth"},
|
|
{"refId": "B", "expr": "max(messenger_queue_oldest_job_age_seconds{service_name=\"messenger-api\"})", "legendFormat": "oldest age (s)"}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {},
|
|
"overrides": [
|
|
{"matcher": {"id": "byName", "options": "depth"}, "properties": [{"id": "unit", "value": "short"}, {"id": "custom.axisPlacement", "value": "left"}]},
|
|
{"matcher": {"id": "byName", "options": "oldest age (s)"}, "properties": [{"id": "unit", "value": "s"}, {"id": "custom.axisPlacement", "value": "right"}]}
|
|
]
|
|
},
|
|
"gridPos": {"h": 8, "w": 8, "x": 0, "y": 16}
|
|
},
|
|
{
|
|
"id": 8,
|
|
"title": "Worker saturation",
|
|
"description": "busy workers / configured worker capacity. Dimensionless ratio displayed as percent.",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [{"refId": "A", "expr": "messenger_worker_busy{service_name=\"messenger-worker\"} / clamp_min(messenger_worker_capacity{service_name=\"messenger-worker\"}, 1)", "legendFormat": "{{service_instance_id}}"}],
|
|
"fieldConfig": {"defaults": {"unit": "percentunit", "min": 0, "max": 1}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 8, "y": 16}
|
|
},
|
|
{
|
|
"id": 9,
|
|
"title": "DB pool used / waiting",
|
|
"description": "Number of HikariCP connections by state plus pending acquisition requests. Unit: connections/requests (count).",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"targets": [
|
|
{"refId": "A", "expr": "sum by (service_name, state) (db_client_connections_usage{service_name=~\"messenger-(api|worker)\"})", "legendFormat": "{{service_name}} {{state}}"},
|
|
{"refId": "B", "expr": "sum by (service_name) (db_client_connections_pending_requests{service_name=~\"messenger-(api|worker)\"})", "legendFormat": "{{service_name}} waiting"}
|
|
],
|
|
"fieldConfig": {"defaults": {"unit": "short"}, "overrides": []},
|
|
"gridPos": {"h": 8, "w": 8, "x": 16, "y": 16}
|
|
},
|
|
{
|
|
"id": 10,
|
|
"title": "Correlated application logs",
|
|
"type": "logs",
|
|
"datasource": {"type": "loki", "uid": "loki"},
|
|
"targets": [{"refId": "A", "expr": "{service_name=~\"messenger-(api|worker)\"} | json", "queryType": "range"}],
|
|
"options": {"showTime": true, "showLabels": false, "wrapLogMessage": true, "prettifyLogMessage": true, "enableLogDetails": true, "sortOrder": "Descending", "dedupStrategy": "none"},
|
|
"gridPos": {"h": 10, "w": 16, "x": 0, "y": 24}
|
|
},
|
|
{
|
|
"id": 11,
|
|
"title": "Recent traces",
|
|
"type": "traces",
|
|
"datasource": {"type": "tempo", "uid": "tempo"},
|
|
"targets": [{"refId": "A", "queryType": "search", "serviceName": "messenger-api", "limit": 20}],
|
|
"gridPos": {"h": 10, "w": 8, "x": 16, "y": 24}
|
|
}
|
|
],
|
|
"refresh": "10s",
|
|
"schemaVersion": 41,
|
|
"tags": ["hla", "lab6", "opentelemetry"],
|
|
"templating": {"list": []},
|
|
"time": {"from": "now-30m", "to": "now"},
|
|
"timepicker": {},
|
|
"timezone": "browser",
|
|
"title": "Messenger observability",
|
|
"uid": "messenger-observability",
|
|
"version": 3,
|
|
"weekStart": ""
|
|
}
|