diff --git a/infra/grafana/provisioning/dashboards/json/messenger.json b/infra/grafana/provisioning/dashboards/json/messenger.json new file mode 100644 index 00000000..76f5acb2 --- /dev/null +++ b/infra/grafana/provisioning/dashboards/json/messenger.json @@ -0,0 +1,79 @@ +{ + "uid": "messenger-lab6", + "title": "Messenger — lab6 observability", + "schemaVersion": 39, + "version": 1, + "editable": true, + "timezone": "browser", + "time": {"from": "now-30m", "to": "now"}, + "templating": { + "list": [ + { + "name": "service", + "type": "query", + "datasource": {"type": "prometheus", "uid": "prometheus"}, + "query": "label_values(up, job)", + "current": {"text": "otel-collector", "value": "otel-collector"} + } + ] + }, + "panels": [ + { + "id": 1, + "type": "timeseries", + "title": "API RPS (total)", + "gridPos": {"x": 0, "y": 0, "w": 8, "h": 8}, + "targets": [ + {"expr": "sum(rate(http_requests_total[1m]))", "legendFormat": "rps"} + ] + }, + { + "id": 2, + "type": "timeseries", + "title": "API error ratio (5xx / total)", + "gridPos": {"x": 8, "y": 0, "w": 8, "h": 8}, + "targets": [ + {"expr": "sum(rate(http_requests_total{http_status_class=\"5xx\"}[5m])) / clamp_min(sum(rate(http_requests_total[5m])), 1e-9)", "legendFormat": "ratio"} + ] + }, + { + "id": 3, + "type": "timeseries", + "title": "HTTP latency p50/p95/p99 (s)", + "gridPos": {"x": 16, "y": 0, "w": 8, "h": 8}, + "targets": [ + {"expr": "histogram_quantile(0.50, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p50"}, + {"expr": "histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p95"}, + {"expr": "histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p99"} + ] + }, + { + "id": 4, + "type": "timeseries", + "title": "Jobs processed by outcome", + "gridPos": {"x": 0, "y": 8, "w": 12, "h": 8}, + "targets": [ + {"expr": "sum by (outcome) (rate(jobs_processed_total[1m]))", "legendFormat": "{{outcome}}"} + ] + }, + { + "id": 5, + "type": "timeseries", + "title": "Job duration p95 (s) by outcome", + "gridPos": {"x": 12, "y": 8, "w": 12, "h": 8}, + "targets": [ + {"expr": "histogram_quantile(0.95, sum by (le, outcome) (rate(job_processing_duration_seconds_bucket[5m])))", "legendFormat": "{{outcome}}"} + ] + }, + { + "id": 6, + "type": "logs", + "title": "API + worker logs", + "gridPos": {"x": 0, "y": 16, "w": 24, "h": 10}, + "datasource": {"type": "loki", "uid": "loki"}, + "targets": [ + {"expr": "{service_name=~\"messenger-api|messenger-worker|messenger-outbox\"}"} + ] + } + ] +} \ No newline at end of file