{ "uid": "messenger-lab6", "title": "Messenger", "tags": ["messenger", "lab6"], "timezone": "browser", "schemaVersion": 39, "version": 1, "refresh": "10s", "time": {"from": "now-30m", "to": "now"}, "panels": [ { "id": 1, "type": "text", "title": "SLI / SLO", "gridPos": {"h": 5, "w": 24, "x": 0, "y": 0}, "options": { "mode": "markdown", "content": "**Availability SLI:** 5xx / all business HTTP requests. Health (`/health/*`) and client 4xx are outside the numerator. **SLO:** 99% success over 5 minutes.\n\n**Latency:** Micrometer exports `http.server.requests` as a histogram in milliseconds (`http_server_requests_milliseconds_bucket`). p50/p95/p99 are `histogram_quantile` over all replicas, then divided by 1000 so the panel is in seconds. Do not average per-replica percentiles.\n\n**Queue:** `messenger_queue_oldest_age_seconds` is the age of the oldest queued or processing attachment. **SLO:** under 30s. This is backlog age, not worker duration.\n\n**Time to ready:** `messenger_job_time_to_ready` is exported in milliseconds. The panel divides the quantile by 1000 and shows seconds, from the committed upload to `ready`." } }, { "id": 2, "type": "timeseries", "title": "Business HTTP RPS", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 12, "x": 0, "y": 5}, "fieldConfig": {"defaults": {"unit": "reqps"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum by (method, uri) (rate(http_server_requests_milliseconds_count{uri!~\"/health.*\"}[1m]))", "legendFormat": "{{method}} {{uri}}" } ] }, { "id": 3, "type": "timeseries", "title": "Business HTTP error ratio (5xx)", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 12, "x": 12, "y": 5}, "fieldConfig": {"defaults": {"unit": "percentunit", "min": 0, "max": 1}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(http_server_requests_milliseconds_count{status=~\"5..\",uri!~\"/health.*\"}[5m])) / clamp_min(sum(rate(http_server_requests_milliseconds_count{uri!~\"/health.*\"}[5m])), 1e-9)", "legendFormat": "5xx ratio" } ] }, { "id": 4, "type": "timeseries", "title": "HTTP duration p50 / p95 / p99", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 12, "x": 0, "y": 13}, "fieldConfig": {"defaults": {"unit": "s"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.50, sum by (le) (rate(http_server_requests_milliseconds_bucket{uri!~\"/health.*\"}[5m]))) / 1000", "legendFormat": "p50" }, { "refId": "B", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_requests_milliseconds_bucket{uri!~\"/health.*\"}[5m]))) / 1000", "legendFormat": "p95" }, { "refId": "C", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_requests_milliseconds_bucket{uri!~\"/health.*\"}[5m]))) / 1000", "legendFormat": "p99" } ] }, { "id": 5, "type": "timeseries", "title": "Jobs per second", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 12, "x": 12, "y": 13}, "fieldConfig": {"defaults": {"unit": "ops"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum by (outcome) (rate(messenger_jobs_total[1m]))", "legendFormat": "{{outcome}}" } ] }, { "id": 6, "type": "timeseries", "title": "Job duration p95", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 0, "y": 21}, "fieldConfig": {"defaults": {"unit": "s"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum by (le, outcome) (rate(messenger_job_duration_milliseconds_bucket[5m]))) / 1000", "legendFormat": "{{outcome}}" } ] }, { "id": 7, "type": "timeseries", "title": "Time to ready p95", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 8, "y": 21}, "fieldConfig": {"defaults": {"unit": "s"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_job_time_to_ready_milliseconds_bucket[5m]))) / 1000", "legendFormat": "p95" } ] }, { "id": 8, "type": "timeseries", "title": "Queue depth and oldest job age", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 16, "y": 21}, "fieldConfig": {"defaults": {"unit": "short"}, "overrides": [{"matcher": {"id": "byName", "options": "oldest age"}, "properties": [{"id": "unit", "value": "s"}]}]}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "max(messenger_queue_depth{queue=\"attachments.process\"})", "legendFormat": "depth" }, { "refId": "B", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "max(messenger_queue_oldest_age_seconds{queue=\"attachments.process\"})", "legendFormat": "oldest age" } ] }, { "id": 9, "type": "timeseries", "title": "DB pool used and waiting", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 0, "y": 29}, "fieldConfig": {"defaults": {"unit": "short"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(hikaricp_connections_active)", "legendFormat": "active" }, { "refId": "B", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(hikaricp_connections_pending)", "legendFormat": "pending" } ] }, { "id": 10, "type": "timeseries", "title": "Worker busy / capacity", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 8, "y": 29}, "fieldConfig": {"defaults": {"unit": "short"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "max(messenger_worker_busy)", "legendFormat": "busy" }, { "refId": "B", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "max(messenger_worker_capacity)", "legendFormat": "capacity" } ] }, { "id": 11, "type": "timeseries", "title": "Process CPU", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 16, "y": 29}, "fieldConfig": {"defaults": {"unit": "percentunit", "min": 0}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "max by (service_name) (process_cpu_usage)", "legendFormat": "{{service_name}}" } ] }, { "id": 12, "type": "timeseries", "title": "Process heap", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": {"h": 8, "w": 12, "x": 0, "y": 37}, "fieldConfig": {"defaults": {"unit": "bytes"}, "overrides": []}, "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}}, "targets": [ { "refId": "A", "datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum by (service_name) (jvm_memory_used_bytes{area=\"heap\"})", "legendFormat": "{{service_name}}" } ] } ] }