Nereus/observability/grafana/dashboards/nereus-api.json

92 lines
3.6 KiB
JSON

{
"annotations": {"list": []},
"editable": false,
"graphTooltip": 1,
"panels": [
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {"defaults": {"unit": "reqps"}},
"gridPos": {"h": 8, "w": 8, "x": 0, "y": 0},
"id": 1,
"targets": [{"expr": "sum by (version) (rate(nereus_http_requests_total{path=~\"/api/v1/.*\",version=~\"$version\"}[1m]))", "legendFormat": "{{version}}", "refId": "A"}],
"title": "API request rate",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {"defaults": {"unit": "percentunit", "min": 0, "max": 1}},
"gridPos": {"h": 8, "w": 8, "x": 8, "y": 0},
"id": 2,
"targets": [{"expr": "sum by (version) (rate(nereus_http_requests_total{path=~\"/api/v1/.*\",status=~\"5..\",version=~\"$version\"}[1m])) / clamp_min(sum by (version) (rate(nereus_http_requests_total{path=~\"/api/v1/.*\",version=~\"$version\"}[1m])), 0.001)", "legendFormat": "{{version}}", "refId": "A"}],
"title": "API error rate",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {"defaults": {"unit": "s"}},
"gridPos": {"h": 8, "w": 8, "x": 16, "y": 0},
"id": 3,
"targets": [{"expr": "histogram_quantile(0.95, sum by (le, version) (rate(nereus_http_request_duration_seconds_bucket{path=~\"/api/v1/.*\",version=~\"$version\"}[5m])))", "legendFormat": "p95 {{version}}", "refId": "A"}],
"title": "API p95 latency",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {"defaults": {"unit": "s"}},
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 8},
"id": 4,
"targets": [{"expr": "histogram_quantile(0.95, sum by (le, operation) (rate(nereus_db_query_duration_seconds_bucket[5m])))", "legendFormat": "{{operation}}", "refId": "A"}],
"title": "Database p95 latency",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"fieldConfig": {"defaults": {"unit": "ops"}},
"gridPos": {"h": 8, "w": 6, "x": 12, "y": 8},
"id": 5,
"targets": [{"expr": "sum(rate(nereus_readings_ingested_total[1m]))", "refId": "A"}],
"title": "Readings ingested",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "prometheus"},
"gridPos": {"h": 8, "w": 6, "x": 18, "y": 8},
"id": 6,
"targets": [{"expr": "nereus_buoys_active", "refId": "A"}],
"title": "Active buoys",
"type": "stat"
},
{
"datasource": {"type": "loki", "uid": "loki"},
"gridPos": {"h": 9, "w": 24, "x": 0, "y": 16},
"id": 7,
"targets": [{"expr": "{k8s_namespace_name=\"nereus\"} | json", "refId": "A"}],
"title": "Correlated API logs",
"type": "logs"
}
],
"refresh": "5s",
"schemaVersion": 42,
"tags": ["nereus"],
"templating": {
"list": [
{
"allValue": ".*",
"current": {"text": "All", "value": "$__all"},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"definition": "label_values(nereus_http_requests_total, version)",
"includeAll": true,
"label": "Version",
"name": "version",
"query": {"query": "label_values(nereus_http_requests_total, version)", "refId": "StandardVariableQuery"},
"refresh": 1,
"type": "query"
}
]
},
"time": {"from": "now-30m", "to": "now"},
"timezone": "browser",
"title": "Nereus API",
"uid": "nereus-api",
"version": 1
}