Files
OmniOilPersonal/infrastructure/monitoring/grafana/dashboards/omnioil-api.json

246 lines
6.5 KiB
JSON

{
"__inputs": [],
"__requires": [],
"annotations": { "list": [] },
"description": "OmniOil SCADA platform API health and business metrics",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"id": 1,
"title": "Active Projects",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 0, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "omnioil_active_projects",
"legendFormat": "Projects",
"refId": "A"
}
],
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": { "calcs": ["lastNotNull"] }
},
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"mode": "absolute",
"steps": [{ "color": "green", "value": null }]
}
}
}
},
{
"id": 2,
"title": "Active Tags",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 6, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "omnioil_active_tags",
"legendFormat": "Tags",
"refId": "A"
}
],
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": { "calcs": ["lastNotNull"] }
},
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"mode": "absolute",
"steps": [{ "color": "blue", "value": null }]
}
}
}
},
{
"id": 3,
"title": "Telemetry Messages Total",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 12, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "omnioil_telemetry_messages_total",
"legendFormat": "Messages",
"refId": "A"
}
],
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": { "calcs": ["lastNotNull"] }
},
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"mode": "absolute",
"steps": [{ "color": "purple", "value": null }]
}
}
}
},
{
"id": 4,
"title": "Alarms Triggered",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 18, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "omnioil_alarms_triggered_total",
"legendFormat": "Alarms",
"refId": "A"
}
],
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": { "calcs": ["lastNotNull"] }
},
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 1 },
{ "color": "red", "value": 10 }
]
}
}
}
},
{
"id": 5,
"title": "HTTP Request Rate",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "sum(rate(axum_http_requests_total[5m])) by (method, endpoint)",
"legendFormat": "{{method}} {{endpoint}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"unit": "reqps"
}
},
"options": { "tooltip": { "mode": "multi" } }
},
{
"id": 6,
"title": "HTTP Error Rate (5xx)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "sum(rate(axum_http_requests_total{http_status_code=~\"5..\"}[5m])) by (endpoint)",
"legendFormat": "5xx {{endpoint}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "fixed", "fixedColor": "red" },
"unit": "reqps"
}
},
"options": { "tooltip": { "mode": "multi" } }
},
{
"id": 7,
"title": "Request Duration p95",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 12 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "histogram_quantile(0.95, sum(rate(axum_http_requests_duration_seconds_bucket[5m])) by (le, endpoint))",
"legendFormat": "p95 {{endpoint}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"unit": "s"
}
},
"options": { "tooltip": { "mode": "multi" } }
},
{
"id": 8,
"title": "Telemetry Rate",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 12 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"targets": [
{
"expr": "rate(omnioil_telemetry_messages_total[5m])",
"legendFormat": "msg/s",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "fixed", "fixedColor": "purple" },
"unit": "mps"
}
},
"options": { "tooltip": { "mode": "multi" } }
}
],
"refresh": "30s",
"schemaVersion": 38,
"tags": ["omnioil", "api", "production"],
"templating": {
"list": [
{
"current": {},
"hide": 0,
"includeAll": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"refresh": 1,
"type": "datasource",
"label": "Datasource"
}
]
},
"time": { "from": "now-1h", "to": "now" },
"timepicker": {},
"timezone": "America/Bogota",
"title": "OmniOil — API Health",
"uid": "omnioil-api-health",
"version": 1
}