{ "uid": "messenger-observability", "title": "Messenger observability", "tags": [ "messenger", "lab6" ], "timezone": "browser", "schemaVersion": 39, "version": 1, "refresh": "10s", "time": { "from": "now-30m", "to": "now" }, "panels": [ { "id": 1, "type": "row", "title": "SLI / SLO", "gridPos": { "x": 0, "y": 0, "w": 24, "h": 1 }, "collapsed": false, "panels": [] }, { "id": 2, "type": "stat", "title": "Availability SLI (1 - 5xx share), selected range", "description": "SLO: 99% of API requests are not 5xx over 30 days. Query: 1 - 5xx/all from http_server_requests_total.", "gridPos": { "x": 0, "y": 1, "w": 6, "h": 4 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "percentunit", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 0.99 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ] }, "colorMode": "value" }, "targets": [ { "refId": "A", "expr": "1 - (sum(increase(http_server_requests_total{http_response_status_class=\"5xx\"}[$__range])) or vector(0)) / sum(increase(http_server_requests_total[$__range]))", "datasource": { "type": "prometheus", "uid": "prometheus" }, "instant": true } ] }, { "id": 3, "type": "stat", "title": "Ready within 10s SLI, selected range", "description": "SLO: 95% of attachments reach ready within 10 s over 30 days. Bucket le=10 of job_time_to_ready_seconds.", "gridPos": { "x": 6, "y": 1, "w": 6, "h": 4 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "percentunit", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 0.95 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ] }, "colorMode": "value" }, "targets": [ { "refId": "A", "expr": "sum(increase(job_time_to_ready_seconds_bucket{le=\"10\"}[$__range])) / sum(increase(job_time_to_ready_seconds_count[$__range]))", "datasource": { "type": "prometheus", "uid": "prometheus" }, "instant": true } ] }, { "id": 4, "type": "stat", "title": "Firing alerts", "description": "Prometheus alert rules in infra/prometheus/rules/alerts.yml", "gridPos": { "x": 12, "y": 1, "w": 6, "h": 4 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ] }, "colorMode": "value" }, "targets": [ { "refId": "A", "expr": "count(ALERTS{alertstate=\"firing\"}) or vector(0)", "datasource": { "type": "prometheus", "uid": "prometheus" }, "instant": true } ] }, { "id": 5, "type": "stat", "title": "Telemetry export errors, 5m", "description": "Failed OTLP exports counted in the application SDK", "gridPos": { "x": 18, "y": 1, "w": 6, "h": 4 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 1 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ] }, "colorMode": "value" }, "targets": [ { "refId": "A", "expr": "sum(increase(telemetry_export_errors_total[5m])) or vector(0)", "datasource": { "type": "prometheus", "uid": "prometheus" }, "instant": true } ] }, { "id": 6, "type": "row", "title": "API", "gridPos": { "x": 0, "y": 5, "w": 24, "h": 1 }, "collapsed": false, "panels": [] }, { "id": 7, "type": "timeseries", "title": "Requests per second by route", "description": "Counter http_server_requests_total, rate over the dashboard interval", "gridPos": { "x": 0, "y": 6, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "stacking": { "mode": "normal", "group": "A" } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (http_route) (rate(http_server_requests_total[$__rate_interval]))", "legendFormat": "{{http_route}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 8, "type": "timeseries", "title": "Error ratio (5xx / all)", "description": "Numerator: 5xx responses, denominator: all API requests (health checks are not recorded). 4xx are client errors and are not counted.", "gridPos": { "x": 8, "y": 6, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "percentunit", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 0.05 } ] } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "(sum(rate(http_server_requests_total{http_response_status_class=\"5xx\"}[$__rate_interval])) or vector(0)) / sum(rate(http_server_requests_total[$__rate_interval]))", "legendFormat": "5xx share", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 9, "type": "timeseries", "title": "Latency p50 / p95 / p99", "description": "histogram_quantile over summed http_server_request_duration_seconds_bucket of all replicas", "gridPos": { "x": 16, "y": 6, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "histogram_quantile(0.50, sum by (le) (rate(http_server_request_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p50", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p95", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p99", "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 10, "type": "row", "title": "Jobs and queue", "gridPos": { "x": 0, "y": 14, "w": 24, "h": 1 }, "collapsed": false, "panels": [] }, { "id": 11, "type": "timeseries", "title": "Jobs per second by outcome", "description": "jobs_processed_total: ready, retry, failed, skipped, lease_lost", "gridPos": { "x": 0, "y": 15, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "ops", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "stacking": { "mode": "normal", "group": "A" } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (outcome) (rate(jobs_processed_total[$__rate_interval]))", "legendFormat": "{{outcome}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 12, "type": "timeseries", "title": "Job duration p50 / p95 / p99", "description": "job_processing_duration_seconds_bucket, worker processing time of one attempt", "gridPos": { "x": 8, "y": 15, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "histogram_quantile(0.50, sum by (le) (rate(job_processing_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p50", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "histogram_quantile(0.95, sum by (le) (rate(job_processing_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p95", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "histogram_quantile(0.99, sum by (le) (rate(job_processing_duration_seconds_bucket[$__rate_interval])))", "legendFormat": "p99", "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 13, "type": "timeseries", "title": "Time to ready p50 / p95 / p99", "description": "job_time_to_ready_seconds: from durable acceptance to ready commit", "gridPos": { "x": 16, "y": 15, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 10 } ] } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "histogram_quantile(0.50, sum by (le) (rate(job_time_to_ready_seconds_bucket[$__rate_interval])))", "legendFormat": "p50", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "histogram_quantile(0.95, sum by (le) (rate(job_time_to_ready_seconds_bucket[$__rate_interval])))", "legendFormat": "p95", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "histogram_quantile(0.99, sum by (le) (rate(job_time_to_ready_seconds_bucket[$__rate_interval])))", "legendFormat": "p99", "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 14, "type": "timeseries", "title": "Queue depth", "description": "Jobs in status queued (max across API replicas, they report the same PostgreSQL value)", "gridPos": { "x": 0, "y": 23, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" }, "min": 0 }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "max by (queue) (queue_depth)", "legendFormat": "{{queue}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 15, "type": "timeseries", "title": "Oldest queued job age", "description": "Seconds since the oldest available queued job became due; alert QueueLagGrowing fires above 20 s", "gridPos": { "x": 8, "y": 23, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 20 } ] } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "max by (queue) (queue_oldest_job_age_seconds)", "legendFormat": "{{queue}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 16, "type": "timeseries", "title": "Worker saturation", "description": "worker_busy jobs in flight versus worker_capacity (WORKER_CONCURRENCY)", "gridPos": { "x": 16, "y": 23, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" }, "min": 0 }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum(worker_busy)", "legendFormat": "busy", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "sum(worker_capacity)", "legendFormat": "capacity", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 17, "type": "row", "title": "Saturation", "gridPos": { "x": 0, "y": 31, "w": 24, "h": 1 }, "collapsed": false, "panels": [] }, { "id": 18, "type": "timeseries", "title": "DB pool connections", "description": "db_pool_connections by state, db_pool_max_connections limit", "gridPos": { "x": 0, "y": 32, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" }, "min": 0 }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (instance) (db_pool_connections{state=\"used\",job=\"messenger-api\"})", "legendFormat": "used {{instance}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "sum(db_pool_connections{state=\"used\",job=\"messenger-worker\"})", "legendFormat": "used worker", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "max(db_pool_max_connections)", "legendFormat": "max", "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 19, "type": "timeseries", "title": "DB pool acquire wait", "description": "Time and count of acquires that had to wait for a free connection", "gridPos": { "x": 8, "y": 32, "w": 8, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (job) (rate(db_pool_acquire_wait_seconds_total[$__rate_interval]))", "legendFormat": "wait s/s {{job}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "sum by (job) (rate(db_pool_empty_acquires_total[$__rate_interval]))", "legendFormat": "waited acquires/s {{job}}", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 20, "type": "timeseries", "title": "Process CPU", "description": "CPU seconds per second of the application processes", "gridPos": { "x": 16, "y": 32, "w": 4, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (job) (rate(process_cpu_time_seconds_total[$__rate_interval]))", "legendFormat": "{{job}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 21, "type": "timeseries", "title": "Process RSS", "description": "Resident memory of the application processes", "gridPos": { "x": 20, "y": 32, "w": 4, "h": 8 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "bytes", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" }, "min": 0 }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (job) (process_memory_usage_bytes)", "legendFormat": "{{job}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 22, "type": "row", "title": "Telemetry pipeline", "gridPos": { "x": 0, "y": 40, "w": 24, "h": 1 }, "collapsed": false, "panels": [] }, { "id": 23, "type": "timeseries", "title": "Collector exporter queue", "description": "Bounded sending queue of each Collector exporter (capacity 100 batches)", "gridPos": { "x": 0, "y": 41, "w": 8, "h": 7 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" }, "min": 0 }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum by (exporter) (otelcol_exporter_queue_size)", "legendFormat": "{{exporter}}", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 24, "type": "timeseries", "title": "Collector send failures", "description": "Data the Collector could not deliver to a storage backend", "gridPos": { "x": 8, "y": 41, "w": 8, "h": 7 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "ops", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "sum(rate(otelcol_exporter_send_failed_spans[$__rate_interval]))", "legendFormat": "spans", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "sum(rate(otelcol_exporter_send_failed_metric_points[$__rate_interval]))", "legendFormat": "metric points", "refId": "B", "datasource": { "type": "prometheus", "uid": "prometheus" } }, { "expr": "sum(rate(otelcol_exporter_send_failed_log_records[$__rate_interval]))", "legendFormat": "log records", "refId": "C", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 25, "type": "timeseries", "title": "Collector memory", "description": "Collector RSS, bounded by memory_limiter and the container limit", "gridPos": { "x": 16, "y": 41, "w": 8, "h": 7 }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "unit": "bytes", "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never" }, "min": 0 }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ { "expr": "otelcol_process_memory_rss", "legendFormat": "rss", "refId": "A", "datasource": { "type": "prometheus", "uid": "prometheus" } } ] }, { "id": 26, "type": "row", "title": "Logs and traces", "gridPos": { "x": 0, "y": 48, "w": 24, "h": 1 }, "collapsed": false, "panels": [] }, { "id": 27, "type": "logs", "title": "Application logs (warn and error)", "datasource": { "type": "loki", "uid": "loki" }, "gridPos": { "x": 0, "y": 49, "w": 12, "h": 10 }, "options": { "showTime": true, "wrapLogMessage": true, "enableLogDetails": true, "sortOrder": "Descending" }, "targets": [ { "refId": "A", "datasource": { "type": "loki", "uid": "loki" }, "expr": "{service_name=~\"messenger-.*\"} | detected_level=~\"warn|error\"" } ] }, { "id": 28, "type": "table", "title": "Recent traces with errors", "datasource": { "type": "tempo", "uid": "tempo" }, "gridPos": { "x": 12, "y": 49, "w": 12, "h": 10 }, "targets": [ { "refId": "A", "datasource": { "type": "tempo", "uid": "tempo" }, "queryType": "traceql", "query": "{ status = error }", "limit": 20, "tableType": "traces" } ] } ], "templating": { "list": [] }, "annotations": { "list": [] } }