Files
mtusi2026lab6/infra/otel/grafana/dashboards/api-overview.json
T

138 lines
5.0 KiB
JSON

{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "unit": "reqps", "color": { "mode": "palette-classic" } }, "overrides": [] },
"gridPos": { "h": 8, "w": 6, "x": 0, "y": 0 },
"id": 1,
"options": { "legend": { "displayMode": "list", "placement": "bottom" } },
"targets": [
{
"expr": "sum(rate(http_requests_total[1m]))",
"legendFormat": "all",
"refId": "A"
},
{
"expr": "sum by (status_class) (rate(http_requests_total[1m]))",
"legendFormat": "{{status_class}}",
"refId": "B"
}
],
"title": "HTTP RPS (by status_class)",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"min": 0,
"max": 1,
"thresholds": { "mode": "absolute", "steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 0.01 },
{ "color": "red", "value": 0.05 }
] }
},
"overrides": []
},
"gridPos": { "h": 8, "w": 6, "x": 6, "y": 0 },
"id": 2,
"options": { "legend": { "displayMode": "list", "placement": "bottom" }, "reduceOptions": { "calcs": ["lastNotNull"] } },
"targets": [
{
"expr": "sum(rate(http_requests_total{status_class=\"5xx\"}[5m])) / sum(rate(http_requests_total[5m]))",
"legendFormat": "5xx ratio",
"refId": "A"
}
],
"title": "HTTP 5xx ratio",
"type": "stat"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] },
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
"id": 3,
"options": { "legend": { "displayMode": "table", "placement": "right", "calcs": ["p50","p95","p99","max"] } },
"targets": [
{
"expr": "histogram_quantile(0.50, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))",
"legendFormat": "p50",
"refId": "A"
},
{
"expr": "histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))",
"legendFormat": "p95",
"refId": "B"
},
{
"expr": "histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))",
"legendFormat": "p99",
"refId": "C"
}
],
"title": "HTTP latency p50/p95/p99 (all routes)",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] },
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
"id": 4,
"options": { "legend": { "displayMode": "table", "placement": "right", "calcs": ["p95","p99"] } },
"targets": [
{
"expr": "histogram_quantile(0.95, sum by (le, route) (rate(http_request_duration_seconds_bucket[5m])))",
"legendFormat": "p95 {{route}}",
"refId": "A"
}
],
"title": "HTTP p95 by route",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] },
"gridPos": { "h": 8, "w": 6, "x": 12, "y": 8 },
"id": 5,
"options": { "legend": { "displayMode": "list", "placement": "bottom" } },
"targets": [
{ "expr": "db_pool_used", "legendFormat": "used {{instance}}", "refId": "A" },
{ "expr": "db_pool_available", "legendFormat": "available {{instance}}", "refId": "B" },
{ "expr": "db_pool_waiting", "legendFormat": "waiting {{instance}}", "refId": "C" }
],
"title": "DB pool",
"type": "timeseries"
},
{
"datasource": { "type": "prometheus", "uid": "prometheus" },
"fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] },
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 8 },
"id": 6,
"options": { "legend": { "displayMode": "list", "placement": "bottom" } },
"targets": [
{ "expr": "sum by (route) (rate(http_requests_total{status_class=~\"4xx|5xx\"}[5m]))", "legendFormat": "{{route}}", "refId": "A" }
],
"title": "Error requests/s by route",
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 39,
"tags": ["messenger", "lab6", "api"],
"templating": { "list": [] },
"time": { "from": "now-15m", "to": "now" },
"timepicker": {},
"timezone": "browser",
"title": "Messenger API Overview",
"uid": "messenger-api-overview",
"version": 1,
"weekStart": ""
}