{ "uid": "factory-workers-queues", "title": "Factory — Workers / Queues", "tags": ["factory", "observability", "worker", "queues"], "timezone": "browser", "schemaVersion": 39, "version": 1, "editable": true, "refresh": "30s", "time": { "from": "now-6h", "to": "now" }, "panels": [ { "id": 1, "type": "timeseries", "title": "Queue depth per queue (waiting + delayed)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 9, "w": 12, "x": 0, "y": 0 }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "fillOpacity": 15 }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 10000 } ] } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "right" }, "thresholds": { "mode": "absolute" } }, "targets": [ { "refId": "A", "expr": "queue_depth{service_name=\"factory-worker\"}", "legendFormat": "{{queue}}" } ] }, { "id": 2, "type": "timeseries", "title": "Job processing p95 by queue (10 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 9, "w": 12, "x": 12, "y": 0 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "factory_worker:queue_job_duration_seconds:p95", "legendFormat": "{{queue}}" } ] }, { "id": 3, "type": "timeseries", "title": "Jobs processed / s by queue (5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 9 }, "fieldConfig": { "defaults": { "unit": "ops", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "factory_worker:queue_jobs:rate5m", "legendFormat": "{{queue}}" } ] }, { "id": 4, "type": "timeseries", "title": "Job duration (mean) by queue (5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 9 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (queue) (rate(queue_job_duration_seconds_sum{service_name=\"factory-worker\"}[5m])) / sum by (queue) (rate(queue_job_duration_seconds_count{service_name=\"factory-worker\"}[5m]))", "legendFormat": "{{queue}}" } ] }, { "id": 5, "type": "timeseries", "title": "Search-index consumer lag (SLO 30 s)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 9 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 30 } ] } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "thresholds": { "mode": "absolute" } }, "targets": [ { "refId": "A", "expr": "search_index_lag_seconds{service_name=\"factory-worker\"}", "legendFormat": "lag" } ] }, { "id": 6, "type": "timeseries", "title": "Worker errors by code (error_total, 5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 17 }, "fieldConfig": { "defaults": { "unit": "ops", "custom": { "drawStyle": "bars" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (code) (rate(error_total{service_name=\"factory-worker\"}[5m]))", "legendFormat": "{{code}}" } ] } ], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "name": "DLQ / retry panels — SPEC GAP", "description": "The spec's Workers/Queues dashboard asks for a DLQ count + retry rate panel, but NEITHER metric is in the spec's 14-metric list (the BullMQ 5 worker records no DLQ/retry metric; failed jobs are visible in the error_total{code} panel above + the /health/search-index:lag probe). Recorded in infrastructure/observability/README.md (spec-conflict, AGENTS rule 29) rather than guessed at — a `queue_failed_jobs_total` metric is the follow-up if the gap matters.", "enable": true, "hide": false, "iconColor": "rgba(255, 96, 96, 1)" } ] } }