diff --git a/ansible/plays/install-error-page.yml b/ansible/plays/install-error-page.yml deleted file mode 100644 index 19bd9822..00000000 --- a/ansible/plays/install-error-page.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- name: Install Custom Error Page on Caddy - hosts: caddy.srv.renner.uno - become: true - vars: - error_page_dir: /var/www/html/errors - error_page_file: custom_error.html - - tasks: - - name: Ensure error page directory exists - file: - path: "{{ error_page_dir }}" - state: directory - mode: '0755' - owner: caddy - group: caddy - - - name: Copy error page - copy: - src: files/custom_error.html - dest: "{{ error_page_dir }}/{{ error_page_file }}" - mode: '0644' - owner: caddy - group: caddy - - - name: Ensure Caddy can read the file - file: - path: "{{ error_page_dir }}/{{ error_page_file }}" - mode: '0644' - - - name: Add Error Page Snippet to Caddyfile - blockinfile: - path: /etc/caddy/Caddyfile - marker: "# {mark} ANSIBLE MANAGED BLOCK: Error Page Snippet" - block: | - (custom_error) { - handle_errors { - rewrite * /{{ error_page_file }} - file_server { - root {{ error_page_dir }} - } - } - } - notify: Reload Caddy - - handlers: - - name: Reload Caddy - service: - name: caddy - state: reloaded diff --git a/ansible/plays/install-gitea-proxy.yml b/ansible/plays/install-gitea-proxy.yml deleted file mode 100644 index 19dccec9..00000000 --- a/ansible/plays/install-gitea-proxy.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Configure Caddy for Gitea - hosts: caddy.srv.renner.uno - become: true - tasks: - - name: Add Gitea reverse proxy config - blockinfile: - path: /etc/caddy/Caddyfile - marker: "# {mark} ANSIBLE MANAGED BLOCK GITEA" - block: | - gitea.renner.uno { - reverse_proxy gitea.srv.renner.uno:3000 - import cloudflare - } - notify: Reload Caddy - - handlers: - - name: Reload Caddy - service: - name: caddy - state: reloaded diff --git a/ansible/roles/grafana-observability/files/dashboards/caddy-overview.json b/ansible/roles/grafana-observability/files/dashboards/caddy-overview.json deleted file mode 100644 index dba4cfce..00000000 --- a/ansible/roles/grafana-observability/files/dashboards/caddy-overview.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "annotations": {"list": []}, - "description": "Caddy Reverse Proxy Performance Metrics", - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": null, - "links": [], - "panels": [ - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}}, - "overrides": [] - }, - "gridPos": {"h": 4, "w": 4, "x": 0, "y": 0}, - "id": 1, - "options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"}, - "targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "count(up{job=\"caddy\"} == 1)", "refId": "A"}], - "title": "Caddy Instances Up", - "type": "stat" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]}, "unit": "reqps"}, - "overrides": [] - }, - "gridPos": {"h": 4, "w": 5, "x": 4, "y": 0}, - "id": 2, - "options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"}, - "targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total[5m]))", "refId": "A"}], - "title": "Requests/sec", - "type": "stat" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 0.5}, {"color": "red", "value": 1}]}, "unit": "s"}, - "overrides": [] - }, - "gridPos": {"h": 4, "w": 5, "x": 9, "y": 0}, - "id": 3, - "options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["mean"], "fields": "", "values": false}, "textMode": "auto"}, - "targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(caddy_http_request_duration_seconds_bucket[5m])) by (le))", "refId": "A"}], - "title": "P95 Latency", - "type": "stat" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "yellow", "value": 1}, {"color": "red", "value": 10}]}, "unit": "percent"}, - "overrides": [] - }, - "gridPos": {"h": 4, "w": 5, "x": 14, "y": 0}, - "id": 4, - "options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"}, - "targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total{code=~\"5..\"}[5m])) / sum(rate(caddy_http_requests_total[5m])) * 100 or vector(0)", "refId": "A"}], - "title": "Error Rate (5xx)", - "type": "stat" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": {"color": {"mode": "thresholds"}, "mappings": [], "thresholds": {"mode": "absolute", "steps": [{"color": "purple", "value": null}]}}, - "overrides": [] - }, - "gridPos": {"h": 4, "w": 5, "x": 19, "y": 0}, - "id": 5, - "options": {"colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"}, - "targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(caddy_http_requests_in_flight)", "refId": "A"}], - "title": "In-Flight Requests", - "type": "stat" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 0, "y": 4}, - "id": 6, - "options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total[5m])) by (instance)", "legendFormat": "{{instance}}", "refId": "A"} - ], - "title": "Request Rate by Instance", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 12, "y": 4}, - "id": 7, - "options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.50, sum(rate(caddy_http_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p50", "refId": "A"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.90, sum(rate(caddy_http_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p90", "refId": "B"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(caddy_http_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p95", "refId": "C"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.99, sum(rate(caddy_http_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p99", "refId": "D"} - ], - "title": "Request Latency Percentiles", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", "fillOpacity": 80, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "normal"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "reqps" - }, - "overrides": [ - {"matcher": {"id": "byRegexp", "options": "2xx"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}, - {"matcher": {"id": "byRegexp", "options": "3xx"}, "properties": [{"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]}, - {"matcher": {"id": "byRegexp", "options": "4xx"}, "properties": [{"id": "color", "value": {"fixedColor": "yellow", "mode": "fixed"}}]}, - {"matcher": {"id": "byRegexp", "options": "5xx"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]} - ] - }, - "gridPos": {"h": 8, "w": 12, "x": 0, "y": 12}, - "id": 8, - "options": {"legend": {"calcs": ["sum"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total{code=~\"2..\"}[5m]))", "legendFormat": "2xx", "refId": "A"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total{code=~\"3..\"}[5m]))", "legendFormat": "3xx", "refId": "B"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total{code=~\"4..\"}[5m]))", "legendFormat": "4xx", "refId": "C"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total{code=~\"5..\"}[5m]))", "legendFormat": "5xx", "refId": "D"} - ], - "title": "Response Status Codes", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "Bps" - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 12, "y": 12}, - "id": 9, - "options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_response_size_bytes_sum[5m]))", "legendFormat": "Response", "refId": "A"}, - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_request_size_bytes_sum[5m]))", "legendFormat": "Request", "refId": "B"} - ], - "title": "Bandwidth", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 0, "y": 20}, - "id": 10, - "options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "sum(rate(caddy_http_requests_total[5m])) by (handler)", "legendFormat": "{{handler}}", "refId": "A"} - ], - "title": "Requests by Handler (Backend)", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 12, "y": 20}, - "id": 11, - "options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "rate(caddy_http_request_errors_total[5m])", "legendFormat": "{{instance}}", "refId": "A"} - ], - "title": "Request Errors/sec", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": {"legend": false, "tooltip": false, "viz": false}, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": {"type": "linear"}, "showPoints": "never", "spanNulls": false, "stacking": {"group": "A", "mode": "none"}, "thresholdsStyle": {"mode": "off"}}, - "mappings": [], - "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 0, "y": 28}, - "id": 12, - "options": {"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true}, "tooltip": {"mode": "multi", "sort": "desc"}}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "histogram_quantile(0.95, sum(rate(caddy_http_response_duration_seconds_bucket[5m])) by (le))", "legendFormat": "Response p95", "refId": "A"} - ], - "title": "Response Time (p95)", - "type": "timeseries" - }, - { - "datasource": {"type": "prometheus", "uid": "prometheus"}, - "fieldConfig": { - "defaults": { - "color": {"mode": "thresholds"}, - "mappings": [{"options": {"0": {"color": "red", "index": 1, "text": "Failed"}, "1": {"color": "green", "index": 0, "text": "Success"}}, "type": "value"}], - "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]} - }, - "overrides": [] - }, - "gridPos": {"h": 8, "w": 12, "x": 12, "y": 28}, - "id": 13, - "options": {"colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "textMode": "auto"}, - "targets": [ - {"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "caddy_config_last_reload_successful", "legendFormat": "{{instance}}", "refId": "A"} - ], - "title": "Config Reload Status", - "type": "stat" - } - ], - "refresh": "30s", - "schemaVersion": 38, - "style": "dark", - "tags": ["homelab", "caddy", "ingress", "reverse-proxy"], - "templating": {"list": []}, - "time": {"from": "now-1h", "to": "now"}, - "timepicker": {}, - "timezone": "", - "title": "Caddy Reverse Proxy", - "uid": "caddy-overview", - "version": 1, - "weekStart": "" -} diff --git a/ansible/roles/grafana-observability/tasks/main.yml b/ansible/roles/grafana-observability/tasks/main.yml index 5c004ad4..7a64e0b2 100644 --- a/ansible/roles/grafana-observability/tasks/main.yml +++ b/ansible/roles/grafana-observability/tasks/main.yml @@ -48,7 +48,6 @@ - proxmox-cluster - docker-overview - unifi-overview - - caddy-overview - netbird-overview - dns-overview - blackbox-overview @@ -113,7 +112,6 @@ mode: '0644' loop: - unifi-overview - - caddy-overview - netbird-overview - dns-overview - blackbox-overview