initial(main): Add files for basic gridscale deployment of 2 hosts with config

This commit is contained in:
Richard
2026-07-28 17:41:48 +02:00
commit 85c3525895
12 changed files with 634 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
{
metrics /metrics {
per_host
observe_catchall_hosts
}
admin :2019 {
origins http://{{ private_ip_caddy }}:2019
}
}
:80 {
root * /usr/share/caddy
file_server
}
+20
View File
@@ -0,0 +1,20 @@
{% raw %}
groups:
- name: demo
rules:
- alert: Caddy Down
expr: up{job="caddy"} == 0
for: 1m
labels:
severity: critical
# 5% 4xx rate is a rough default. Client-error rates vary widely by application (bots, API misuse, rate limits, short-lived token expiry, malformed clients) — adjust based on your baseline.
- alert: CaddyHighHTTP4xxErrorRateService
expr: sum(rate(caddy_http_request_duration_seconds_count{code=~"4.."}[3m])) by (instance) / sum(rate(caddy_http_request_duration_seconds_count[3m])) by (instance) * 100 > 5 and sum(rate(caddy_http_request_duration_seconds_count[3m])) by (instance) > 0
for: 1m
labels:
severity: critical
annotations:
summary: Caddy high HTTP 4xx error rate service (instance {{ $labels.instance }})
description: "Caddy service 4xx error rate is above 5%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
{% endraw %}
+10
View File
@@ -0,0 +1,10 @@
global:
scrape_interval: 15s # default is 1 minute
rule_files:
- /etc/prometheus/alert_rules.yml
scrape_configs:
- job_name: caddy
static_configs:
- targets: ['{{ private_ip_caddy }}:2019']