{ "annotations": { "list": [] }, "editable": false, "graphTooltip": 1, "id": null, "links": [], "panels": [ { "id": 1, "title": "API RPS", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 6, "x": 0, "y": 0 }, "fieldConfig": { "defaults": { "unit": "reqps" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum(rate(messenger_http_server_requests_total[1m]))", "legendFormat": "requests/s" } ] }, { "id": 2, "title": "API 5xx ratio", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 6, "x": 6, "y": 0 }, "fieldConfig": { "defaults": { "unit": "percentunit" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum(rate(messenger_http_server_requests_total{status_class=\"5xx\"}[1m])) / clamp_min(sum(rate(messenger_http_server_requests_total[1m])), 0.000001)", "legendFormat": "5xx / all" } ] }, { "id": 3, "title": "API latency p50/p95/p99", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 0 }, "fieldConfig": { "defaults": { "unit": "s" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "histogram_quantile(0.50, sum by (le) (rate(messenger_http_server_duration_seconds_bucket[5m])))", "legendFormat": "p50" }, { "refId": "B", "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_http_server_duration_seconds_bucket[5m])))", "legendFormat": "p95" }, { "refId": "C", "expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_http_server_duration_seconds_bucket[5m])))", "legendFormat": "p99" } ] }, { "id": 4, "title": "Queue depth / oldest age seconds", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 7 }, "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "max(messenger_queue_depth)", "legendFormat": "depth" }, { "refId": "B", "expr": "max(messenger_queue_oldest_job_age_seconds)", "legendFormat": "oldest age s" } ] }, { "id": 5, "title": "Worker saturation", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 7 }, "fieldConfig": { "defaults": { "unit": "percentunit" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "max(messenger_worker_busy) / clamp_min(max(messenger_worker_capacity), 1)", "legendFormat": "busy / capacity" } ] }, { "id": 6, "title": "Time to ready p50/p95/p99", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 7 }, "fieldConfig": { "defaults": { "unit": "s" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "histogram_quantile(0.50, sum by (le) (rate(messenger_attachment_ready_duration_seconds_bucket[5m])))", "legendFormat": "p50" }, { "refId": "B", "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_attachment_ready_duration_seconds_bucket[5m])))", "legendFormat": "p95" }, { "refId": "C", "expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_attachment_ready_duration_seconds_bucket[5m])))", "legendFormat": "p99" } ] }, { "id": 7, "title": "PostgreSQL pool used/idle/capacity", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 14 }, "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (service_name, state) (messenger_db_pool_connections)", "legendFormat": "{{service_name}} {{state}}" } ] }, { "id": 8, "title": "PostgreSQL pool waits", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 14 }, "fieldConfig": { "defaults": { "unit": "ops" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (service_name) (rate(messenger_db_pool_waits_total[5m]))", "legendFormat": "{{service_name}} waits/s" } ] }, { "id": 9, "title": "Process CPU", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 14 }, "fieldConfig": { "defaults": { "unit": "percentunit" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (service_name) (rate(messenger_process_cpu_time_seconds_total[5m]))", "legendFormat": "{{service_name}}" } ] }, { "id": 10, "title": "Process RSS", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 21 }, "fieldConfig": { "defaults": { "unit": "bytes" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "max by (service_name) (messenger_process_memory_bytes)", "legendFormat": "{{service_name}}" } ] }, { "id": 11, "title": "Worker jobs and p95 duration", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 21 }, "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (outcome) (rate(messenger_worker_jobs_total[5m]))", "legendFormat": "jobs/s {{outcome}}" }, { "refId": "B", "expr": "histogram_quantile(0.95, sum by (le, outcome) (rate(messenger_worker_job_duration_seconds_bucket[5m])))", "legendFormat": "p95 s {{outcome}}" } ] }, { "id": 12, "title": "Collector bounded queues / drops", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 21 }, "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "otelcol_exporter_queue_size", "legendFormat": "queue {{exporter}}" }, { "refId": "B", "expr": "otelcol_exporter_queue_capacity", "legendFormat": "capacity {{exporter}}" }, { "refId": "C", "expr": "(sum(rate(otelcol_exporter_send_failed_log_records[5m])) or vector(0)) + (sum(rate(otelcol_exporter_send_failed_spans[5m])) or vector(0))", "legendFormat": "drops/s" } ] }, { "id": 13, "title": "Alert state", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 28 }, "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "ALERTS{alertname=~\"Messenger(APIHighErrorRate|QueueLagGrowing)\"}", "legendFormat": "{{alertname}} {{alertstate}}" } ] }, { "id": 14, "title": "Correlated logs", "type": "logs", "datasource": { "type": "loki", "uid": "loki" }, "gridPos": { "h": 10, "w": 16, "x": 8, "y": 28 }, "targets": [ { "refId": "A", "expr": "{service_name=~\"messenger-(api|worker|dispatcher)\"}", "queryType": "range" } ], "options": { "dedupStrategy": "none", "enableLogDetails": true, "showCommonLabels": false, "showLabels": false, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": true } } ], "refresh": "5s", "schemaVersion": 41, "tags": [ "mtusi", "lab6", "grade4" ], "templating": { "list": [] }, "time": { "from": "now-30m", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "MTUSI Lab 6 - Grade 4", "uid": "mtusi-lab7-grade4", "version": 1 }