Compare commits

..
2 Commits
Author SHA1 Message Date
fauno 80d95ce4a2 fix: logging is opt-in 2026-11-05 15:45:23 -03:00
fauno d5ad82a30a feat: access log coop-cloud/traefik#126 2026-11-05 15:45:00 -03:00
12 changed files with 25 additions and 33 deletions
+7 -5
View File
@@ -23,11 +23,6 @@ SECRET_BASIC_AUTH_VERSION=v1
# Enable container filesystem usage metrics (expensive du-scan, ~30% CPU on large hosts)
# CADVISOR_DISK_USAGE=1
# How often metrics are sent to Prometheus, and how often cadvisor
# refreshes its container stats. Keep the second value lower than the first.
# PROMETHEUS_SCRAPE_INTERVAL=120s
# CADVISOR_HOUSEKEEPING_INTERVAL=60s
# Enable authenticated scraping of containers that opt in via
# prometheus.io/auth=basic or prometheus.io/auth=bearer labels (used as
# password/bearer token respectively). Insert it with:
@@ -158,3 +153,10 @@ SECRET_BASIC_AUTH_VERSION=v1
# Traefik apdex alert will trigger when the apdex score of a service drops below the given number. Services receiving fewer than 10 requests per 10m are ignored
#ALERT_TRAEFIK_APDEX=0.5
# Tell Traefik to keep access logs (could be very verbose). See Access
# logs on Traefik recipe.
#ALLOY_ACCESS_LOGS=true
#PROMETHEUS_ACCESS_LOGS=true
#LOKI_ACCESS_LOGS=true
#GRAFANA_ACCESS_LOGS=true
-2
View File
@@ -1,3 +1 @@
.*smartctl.* @fauno
compose\.docker-events\.yml @simon
* @coop-cloud/monitoring-ng-maintainers
+1 -1
View File
@@ -11,7 +11,7 @@ export MATRIX_ALERTMANAGER_CONFIG_VERSION=v2
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=v1
export GF_ALERTS_NODE_VERSION=v5
export GF_ALERTS_LOKI_VERSION=v5
export CONFIG_ALLOY_VERSION=v5
export CONFIG_ALLOY_VERSION=v3
export GF_ALERTS_TRAEFIK_VERSION=v1
# migrates secrets from old names to new names by reading values from the
+1
View File
@@ -14,3 +14,4 @@ services:
- "traefik.http.routers.${STACK_NAME}-alloy.tls=true"
- "traefik.http.routers.${STACK_NAME}-alloy.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}-alloy.middlewares=basicauth@file"
- "traefik.http.routers.${STACK_NAME}-alloy.observability.accesslogs=${ALLOY_ACCESS_LOGS:-false}"
+1 -1
View File
@@ -1,7 +1,7 @@
version: "3.8"
services:
docker-events:
image: docker:29.10.1-cli
image: docker:29.8.1-cli
command: >
docker events
--format '{{json .}}'
+2 -1
View File
@@ -2,7 +2,7 @@ version: '3.8'
services:
grafana:
image: grafana/grafana:13.3.2
image: grafana/grafana:13.3.0
volumes:
- grafana-data:/var/lib/grafana:rw
secrets:
@@ -51,6 +51,7 @@ services:
- "traefik.http.routers.${STACK_NAME}-grafana.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-grafana.tls=true"
- "traefik.http.routers.${STACK_NAME}-grafana.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}-grafana.observability.accesslogs=${GRAFANA_ACCESS_LOGS:-false}"
healthcheck:
test: "wget -q http://localhost:3000/healthz -O/dev/null"
interval: 5s
+2 -1
View File
@@ -2,7 +2,7 @@ version: '3.8'
services:
loki:
image: grafana/loki:3.7.10
image: grafana/loki:3.7.9
command: -config.file=/etc/loki/local-config.yaml
networks:
- proxy
@@ -42,6 +42,7 @@ services:
- "traefik.http.routers.${STACK_NAME}-loki.tls=true"
- "traefik.http.routers.${STACK_NAME}-loki.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}-loki.middlewares=basicauth@file"
- "traefik.http.routers.${STACK_NAME}-loki.observability.accesslogs=${LOKI_ACCESS_LOGS:-false}"
- "prometheus.io/scrape=true"
- "prometheus.io/port=3100"
+1
View File
@@ -38,6 +38,7 @@ services:
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}-prometheus.middlewares=basicauth@file"
- "traefik.http.routers.${STACK_NAME}-prometheus.observability.accesslogs=${PROMETHEUS_ACCESS_LOGS:-false}"
configs:
prometheus_yml:
+2 -2
View File
@@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: grafana/alloy:v1.22.0
image: grafana/alloy:v1.21.3
hostname: "${DOMAIN}"
configs:
- source: config_alloy
@@ -53,7 +53,7 @@ services:
condition: any
labels:
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
- "coop-cloud.${STACK_NAME}.version=2.5.1+v1.22.0"
- "coop-cloud.${STACK_NAME}.version=2.4.0+v1.21.3"
configs:
config_alloy:
template_driver: golang
+8 -18
View File
@@ -21,8 +21,6 @@ prometheus.exporter.cadvisor "docker" {
{{ end }}
// host-wide totals already come from prometheus.exporter.unix
disable_root_cgroup_stats = true
housekeeping_interval = "{{ or (env "CADVISOR_HOUSEKEEPING_INTERVAL") "60s" }}"
max_housekeeping_interval = "{{ or (env "CADVISOR_HOUSEKEEPING_INTERVAL") "60s" }}"
}
prometheus.exporter.unix "default" {
@@ -46,7 +44,7 @@ prometheus.exporter.unix "default" {
prometheus.exporter.self "alloy" {}
prometheus.scrape "default" {
scrape_interval = "{{ or (env "PROMETHEUS_SCRAPE_INTERVAL") "120s" }}"
scrape_interval = "120s"
targets = array.concat(
prometheus.exporter.self.alloy.targets,
@@ -253,14 +251,14 @@ discovery.relabel "metrics_bearerauth" {
}
prometheus.scrape "containers" {
scrape_interval = "{{ or (env "PROMETHEUS_SCRAPE_INTERVAL") "120s" }}"
scrape_interval = "120s"
targets = discovery.relabel.metrics_noauth.output
forward_to = [prometheus.remote_write.prometheus.receiver]
}
{{ if ne (env "SECRET_SCRAPE_AUTH_VERSION") "" }}
prometheus.scrape "containers_basicauth" {
scrape_interval = "{{ or (env "PROMETHEUS_SCRAPE_INTERVAL") "120s" }}"
scrape_interval = "120s"
targets = discovery.relabel.metrics_basicauth.output
forward_to = [prometheus.remote_write.prometheus.receiver]
basic_auth {
@@ -270,7 +268,7 @@ prometheus.scrape "containers_basicauth" {
}
prometheus.scrape "containers_bearerauth" {
scrape_interval = "{{ or (env "PROMETHEUS_SCRAPE_INTERVAL") "120s" }}"
scrape_interval = "120s"
targets = discovery.relabel.metrics_bearerauth.output
forward_to = [prometheus.remote_write.prometheus.receiver]
bearer_token = "{{ secret "scrape_auth" }}"
@@ -308,7 +306,7 @@ loki.source.docker "docker" {
host = "unix:///var/run/docker.sock"
targets = discovery.relabel.docker.output
labels = {"app" = "docker"}
forward_to = [loki.process.drop_old.receiver]
forward_to = [loki.write.loki.receiver]
}
// JOURNALD: reads the systemd journal binary log directly.
@@ -340,7 +338,7 @@ loki.relabel "journal" {
// drop network db stats (15-20% of kernel logs)
loki.process "journal" {
forward_to = [loki.process.drop_old.receiver]
forward_to = [loki.write.loki.receiver]
stage.drop {
expression = ".*NetworkDB stats.*"
@@ -365,7 +363,7 @@ loki.process "syslog_files" {
stage.static_labels {
values = { job = "syslog" }
}
forward_to = [loki.process.drop_old.receiver]
forward_to = [loki.write.loki.receiver]
}
{{ end }}
@@ -392,18 +390,10 @@ loki.source.syslog "syslog" {
}
relabel_rules = loki.relabel.syslog.rules
forward_to = [loki.process.drop_old.receiver]
forward_to = [loki.write.loki.receiver]
}
{{ end }}
loki.process "drop_old" {
forward_to = [loki.write.loki.receiver]
stage.drop {
older_than = "160h"
}
}
loki.write "loki" {
endpoint {
url = "{{ env "LOKI_PUSH_URL" }}"
-1
View File
@@ -1 +0,0 @@
fixes two grafana releases: https://github.com/grafana/grafana/releases/tag/v13.3.2 and alloy drops logs older than 160 hours
-1
View File
@@ -1 +0,0 @@
cadvisor's housekeeping interval now defaults to 60s (previously 1s regardless of scrape interval) and is configurable via the new CADVISOR_HOUSEKEEPING_INTERVAL env var; the Prometheus scrape interval is configurable too, via the new PROMETHEUS_SCRAPE_INTERVAL env var (default 120s, unchanged).