diff --git a/docker-compose.yml b/docker-compose.yml index 3d376c8..ce0e72e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,6 +80,8 @@ services: - prometheus volumes: - grafana_data:/var/lib/grafana + - ./infra/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards + - ./infra/grafana/dashboards:/var/lib/grafana/dashboards volumes: redis_data: diff --git a/implementation_plan.md b/implementation_plan.md index 4a3054c..aeafc30 100644 --- a/implementation_plan.md +++ b/implementation_plan.md @@ -55,3 +55,9 @@ Transition the system from a functional prototype to a scalable, production-read - **Changes**: - `infra/prometheus.yml`: Added `dns_sd_configs` for `camoufox-pool` port 8000. - **Verification**: Metrics availability (User Field Verification). + +## v1.1.0 Dashboarding (Planned) +- **Goal**: Visualize core metrics (Auth, Extract, Latency) in Grafana. +- **Changes**: + - Provisioned `FAEA Overview` dashboard. + - Mounted configuration in `docker-compose.yml`. diff --git a/infra/grafana/dashboards/faea_overview.json b/infra/grafana/dashboards/faea_overview.json new file mode 100644 index 0000000..ab3e1c3 --- /dev/null +++ b/infra/grafana/dashboards/faea_overview.json @@ -0,0 +1,279 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "expr": "auth_attempts_total", + "legendFormat": "Auth Attempts {{status}}", + "refId": "A" + } + ], + "title": "Auth Attempts", + "type": "timeseries" + }, + { + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "expr": "extraction_requests_total", + "legendFormat": "Extractions {{status}}", + "refId": "A" + } + ], + "title": "Extraction Throughput", + "type": "timeseries" + }, + { + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "expr": "histogram_quantile(0.95, sum(rate(session_duration_seconds_bucket[5m])) by (le))", + "legendFormat": "p95 Duration", + "refId": "A" + } + ], + "title": "p95 Session Duration", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 30, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "FAEA Overview", + "uid": "faea_overview", + "version": 1, + "weekStart": "" +} \ No newline at end of file diff --git a/infra/grafana/provisioning/dashboards/faea_dashboard.yml b/infra/grafana/provisioning/dashboards/faea_dashboard.yml new file mode 100644 index 0000000..68a10cc --- /dev/null +++ b/infra/grafana/provisioning/dashboards/faea_dashboard.yml @@ -0,0 +1,11 @@ +apiVersion: 1 + +providers: + - name: 'FAEA Dashboards' + orgId: 1 + folder: '' + type: file + disableDeletion: false + updateIntervalSeconds: 10 + options: + path: /var/lib/grafana/dashboards