{ "uid": "messenger-lab6", "title": "Messenger lab6 - Observability", "description": "Application OTLP metrics, structured logs and traces. HTTP error ratio is business 5xx / all business responses; health excluded. Duration units are seconds. All API replicas are aggregated.", "tags": [ "lab6", "opentelemetry" ], "schemaVersion": 39, "version": 1, "editable": false, "timezone": "browser", "refresh": "5s", "time": { "from": "now-15m", "to": "now" }, "panels": [ { "id": 1, "type": "timeseries", "title": "Business API requests / second", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "expr": "sum(rate(messenger_http_requests_total{service_name=\"messenger-api\",route!~\"/health/.*\"}[$__rate_interval]))", "legendFormat": "" } ], "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 2, "type": "timeseries", "title": "Business API 5xx / all responses", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 0, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "expr": "sum(rate(messenger_http_requests_total{service_name=\"messenger-api\",route!~\"/health/.*\",status_class=\"5xx\"}[$__rate_interval])) / clamp_min(sum(rate(messenger_http_requests_total{service_name=\"messenger-api\",route!~\"/health/.*\"}[$__rate_interval])), 1e-9)", "legendFormat": "" } ], "fieldConfig": { "defaults": { "unit": "percentunit", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 3, "type": "timeseries", "title": "API mean duration (seconds)", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 8, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "expr": "sum(rate(messenger_http_duration_seconds_sum{service_name=\"messenger-api\",route!~\"/health/.*\"}[$__rate_interval])) / clamp_min(sum(rate(messenger_http_duration_seconds_count{service_name=\"messenger-api\",route!~\"/health/.*\"}[$__rate_interval])), 1e-9)", "legendFormat": "" } ], "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 4, "type": "timeseries", "title": "Worker attempt outcomes / second", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 8, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "expr": "sum by (outcome) (rate(messenger_jobs_processed_total{service_name=\"messenger-worker\"}[$__rate_interval]))", "legendFormat": "{{outcome}}" } ], "fieldConfig": { "defaults": { "unit": "ops", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 5, "type": "timeseries", "title": "Worker mean attempt duration (seconds)", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 16, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "expr": "sum(rate(messenger_jobs_duration_seconds_sum{service_name=\"messenger-worker\"}[$__rate_interval])) / clamp_min(sum(rate(messenger_jobs_duration_seconds_count{service_name=\"messenger-worker\"}[$__rate_interval])), 1e-9)", "legendFormat": "" } ], "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 6, "type": "timeseries", "title": "Worker completed attempts (counter)", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 16, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "expr": "sum by (outcome) (messenger_jobs_processed_total{service_name=\"messenger-worker\"})", "legendFormat": "{{outcome}}" } ], "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 7, "type": "logs", "title": "Structured application events (expand for trace_id / span_id / request_id)", "datasource": { "type": "loki", "uid": "loki" }, "gridPos": { "x": 0, "y": 24, "w": 24, "h": 9 }, "targets": [ { "refId": "A", "expr": "{service_name=~\"messenger-api|messenger-worker|messenger-publisher\"}", "queryType": "range" } ], "options": { "showTime": true, "showLabels": false, "wrapLogMessage": true, "enableLogDetails": true, "sortOrder": "Descending" } }, { "id": 8, "type": "table", "title": "Recent real API / worker traces (open TraceID)", "datasource": { "type": "tempo", "uid": "tempo" }, "gridPos": { "x": 0, "y": 33, "w": 24, "h": 8 }, "targets": [ { "refId": "A", "queryType": "traceql", "query": "{ resource.service.name = \"messenger-api\" || resource.service.name = \"messenger-worker\" }", "limit": 20, "tableType": "traces" } ], "options": { "showHeader": true } } ], "annotations": { "list": [] }, "templating": { "list": [] } }