From 28f875aa7df0ce812da7fe6e5f61b53d96cf61a5 Mon Sep 17 00:00:00 2001 From: njdifiore91 Date: Thu, 9 Jan 2025 21:48:56 -0500 Subject: [PATCH] Add public-samples/startup-metrics-hizlkn/infrastructure/monitoring/grafana-dashboards/api.json --- .../monitoring/grafana-dashboards/api.json | 302 ++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 infrastructure/monitoring/grafana-dashboards/api.json diff --git a/infrastructure/monitoring/grafana-dashboards/api.json b/infrastructure/monitoring/grafana-dashboards/api.json new file mode 100644 index 0000000000..0416356865 --- /dev/null +++ b/infrastructure/monitoring/grafana-dashboards/api.json @@ -0,0 +1,302 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "API Performance Dashboard for Startup Metrics Benchmarking Platform", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1, + "links": [], + "panels": [ + { + "title": "API Request Rate", + "type": "graph", + "datasource": "Prometheus", + "targets": [ + { + "expr": "rate(http_requests_total[5m])", + "legendFormat": "{{method}} {{path}}", + "interval": "", + "exemplar": true + } + ], + "gridPos": { + "x": 0, + "y": 0, + "w": 12, + "h": 8 + }, + "fill": 1, + "fillGradient": 0, + "linewidth": 1, + "pointradius": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "timeRegions": [] + }, + { + "title": "Response Time Distribution", + "type": "heatmap", + "datasource": "Prometheus", + "targets": [ + { + "expr": "rate(http_request_duration_seconds_bucket[5m])", + "format": "heatmap", + "interval": "", + "legendFormat": "{{le}}" + } + ], + "gridPos": { + "x": 12, + "y": 0, + "w": 12, + "h": 8 + }, + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#b4ff00", + "colorScale": "linear", + "colorScheme": "interpolateSpectral", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "tsbuckets", + "yBucketBound": "auto" + }, + { + "title": "Error Rate by Status Code", + "type": "graph", + "datasource": "Prometheus", + "targets": [ + { + "expr": "sum(rate(http_requests_total{status=~\"5..|4..\"}[5m])) by (status)", + "legendFormat": "{{status}}", + "interval": "", + "exemplar": true + } + ], + "gridPos": { + "x": 0, + "y": 8, + "w": 12, + "h": 8 + }, + "fill": 1, + "fillGradient": 0, + "linewidth": 1, + "pointradius": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "aliasColors": { + "5xx": "red", + "4xx": "orange" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 10, + "visible": true + } + ] + }, + { + "title": "System Uptime", + "type": "stat", + "datasource": "Prometheus", + "targets": [ + { + "expr": "avg_over_time(up{job=\"api\"}[24h]) * 100", + "legendFormat": "Uptime %", + "instant": true + } + ], + "gridPos": { + "x": 12, + "y": 8, + "w": 6, + "h": 4 + }, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "red", "value": null }, + { "color": "orange", "value": 95 }, + { "color": "green", "value": 99.9 } + ] + }, + "unit": "percent", + "decimals": 2 + } + } + }, + { + "title": "95th Percentile Response Time", + "type": "gauge", + "datasource": "Prometheus", + "targets": [ + { + "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))", + "legendFormat": "P95 Response Time", + "instant": true + } + ], + "gridPos": { + "x": 18, + "y": 8, + "w": 6, + "h": 4 + }, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "orange", "value": 1 }, + { "color": "red", "value": 2 } + ] + }, + "unit": "s", + "max": 5, + "decimals": 2 + } + } + } + ], + "refresh": "10s", + "schemaVersion": 36, + "style": "dark", + "tags": ["api", "performance", "monitoring", "sla"], + "templating": { + "list": [ + { + "current": {}, + "datasource": "Prometheus", + "definition": "label_values(up{job=\"api\"}, instance)", + "hide": 0, + "includeAll": true, + "label": "Instance", + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(up{job=\"api\"}, instance)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": "Prometheus", + "definition": "label_values(http_requests_total, path)", + "hide": 0, + "includeAll": true, + "label": "Endpoint", + "multi": true, + "name": "endpoint", + "options": [], + "query": "label_values(http_requests_total, path)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "browser", + "title": "API Performance Dashboard", + "uid": "api-performance", + "version": 1, + "weekStart": "" +} \ No newline at end of file