{ "id": null, "uid": "lab6-messenger", "title": "Lab6 - Messenger Observability", "tags": [ "lab6", "messenger", "opentelemetry" ], "timezone": "browser", "schemaVersion": 39, "version": 2, "editable": false, "refresh": "10s", "time": { "from": "now-30m", "to": "now" }, "panels": [ { "id": 1, "title": "HTTP Request Rate", "description": "HTTP requests per second by method and route", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (method, route) (rate(messenger_http_requests_total[$__rate_interval]))", "legendFormat": "{{method}} {{route}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "reqps", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 2, "title": "HTTP Errors (5xx)", "description": "Server errors per second", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 0, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(messenger_http_requests_total{status_code=~\"5..\"}[$__rate_interval])) or (0 * sum(rate(messenger_http_requests_total[$__rate_interval])))", "legendFormat": "5xx errors", "range": true } ], "fieldConfig": { "defaults": { "unit": "reqps", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 3, "title": "HTTP Request Duration", "description": "Mean HTTP request duration", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 8, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(messenger_http_request_duration_seconds_sum[$__rate_interval])) / sum(rate(messenger_http_request_duration_seconds_count[$__rate_interval]))", "legendFormat": "Mean duration", "range": true } ], "fieldConfig": { "defaults": { "unit": "s", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 4, "title": "Successful Jobs", "description": "Successful job processing attempts over five minutes", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 8, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(increase(messenger_jobs_total{outcome=\"success\"}[5m])) or (0 * sum(increase(messenger_jobs_total[5m])))", "legendFormat": "Successful jobs", "range": true } ], "fieldConfig": { "defaults": { "unit": "short", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 5, "title": "Failed Jobs and Retries", "description": "Failed and retried job attempts over five minutes", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 16, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(increase(messenger_jobs_total{outcome=~\"failed|error\"}[5m])) or (0 * sum(increase(messenger_jobs_total[5m])))", "legendFormat": "Failed attempts", "range": true }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(increase(messenger_jobs_total{outcome=\"retry\"}[5m])) or (0 * sum(increase(messenger_jobs_total[5m])))", "legendFormat": "Retries", "range": true } ], "fieldConfig": { "defaults": { "unit": "short", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 6, "title": "Job Processing Duration", "description": "Mean job processing duration by outcome", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 16, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (outcome) (rate(messenger_job_duration_seconds_sum[$__rate_interval])) / sum by (outcome) (rate(messenger_job_duration_seconds_count[$__rate_interval]))", "legendFormat": "{{outcome}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "s", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 7, "title": "HTTP Latency Percentiles", "description": "Business request latency across both API replicas", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 24, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.5, sum by (le) (rate(messenger_http_request_duration_seconds_bucket{route=~\"/api/.*\"}[$__rate_interval])))", "legendFormat": "p50", "range": true }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_http_request_duration_seconds_bucket{route=~\"/api/.*\"}[$__rate_interval])))", "legendFormat": "p95", "range": true }, { "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_http_request_duration_seconds_bucket{route=~\"/api/.*\"}[$__rate_interval])))", "legendFormat": "p99", "range": true } ], "fieldConfig": { "defaults": { "unit": "s", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 8, "title": "HTTP Error Ratio", "description": "5xx divided by all business API requests; health excluded", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 24, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "100 * (sum(rate(messenger_http_requests_total{route=~\"/api/.*\",status_code=~\"5..\"}[$__rate_interval])) or (0 * sum(rate(messenger_http_requests_total{route=~\"/api/.*\"}[$__rate_interval])))) / (sum(rate(messenger_http_requests_total{route=~\"/api/.*\"}[$__rate_interval])) > 0)", "legendFormat": "5xx ratio", "range": true } ], "fieldConfig": { "defaults": { "unit": "percent", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 9, "title": "Queue Backlog", "description": "Durable queued attachment jobs", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 32, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "max by (queue_name) (messenger_queue_depth)", "legendFormat": "{{queue_name}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "short", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 10, "title": "Oldest Queued Job Age", "description": "Age of oldest queued attachment job", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 32, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "max by (queue_name) (messenger_queue_oldest_age_seconds)", "legendFormat": "{{queue_name}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "s", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 11, "title": "Database Pool Used / Capacity", "description": "Checked-out connections and maximum capacity per process", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 40, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_db_pool_used", "legendFormat": "Used {{service_name}} {{service_instance_id}}", "range": true }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_db_pool_capacity", "legendFormat": "Capacity {{service_name}} {{service_instance_id}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "short", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 12, "title": "Database Pool Waiting", "description": "Connection acquisitions waiting on the pool queue", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 40, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_db_pool_waiting", "legendFormat": "{{service_name}} {{service_instance_id}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "short", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 13, "title": "Worker Busy / Capacity", "description": "Concurrent active processing attempts and worker capacity", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 48, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_worker_busy", "legendFormat": "Busy", "range": true }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_worker_capacity", "legendFormat": "Capacity", "range": true } ], "fieldConfig": { "defaults": { "unit": "short", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 14, "title": "Process CPU", "description": "CPU utilization per process; 100% equals one CPU core", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 48, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_process_cpu_percent", "legendFormat": "{{service_name}} {{service_instance_id}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "percent", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 15, "title": "Process RAM", "description": "Resident memory per application process", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 56, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger_process_memory_bytes", "legendFormat": "{{service_name}} {{service_instance_id}}", "range": true } ], "fieldConfig": { "defaults": { "unit": "bytes", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } }, { "id": 16, "title": "Attachment End-to-End Time", "description": "Time from durable acceptance to committed ready state", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 56, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.5, sum by (le) (rate(messenger_attachment_ready_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p50", "range": true }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_attachment_ready_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p95", "range": true }, { "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_attachment_ready_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p99", "range": true } ], "fieldConfig": { "defaults": { "unit": "s", "min": 0, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "auto" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } } } ] }