From c9d80df34dfb9d95ca3de566615af8b1fc1c8aee Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Thu, 11 May 2023 15:08:07 +0200 Subject: [PATCH] feat: enable public facing metrics --- .env.sample | 1 + abra.sh | 2 +- compose.metrics.yml | 7 +++++++ traefik.yml.tmpl | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 compose.metrics.yml diff --git a/.env.sample b/.env.sample index 0e0c3c9..62c6352 100644 --- a/.env.sample +++ b/.env.sample @@ -63,6 +63,7 @@ COMPOSE_FILE="compose.yml" ## Enable prometheus metrics collection ## used used by the coop-cloud monitoring stack +#COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml" #METRICS_ENABLED=1 ##################################################################### diff --git a/abra.sh b/abra.sh index 6f44e73..fcae9d8 100644 --- a/abra.sh +++ b/abra.sh @@ -1,3 +1,3 @@ -export TRAEFIK_YML_VERSION=v16 +export TRAEFIK_YML_VERSION=v17 export FILE_PROVIDER_YML_VERSION=v8 export ENTRYPOINT_VERSION=v2 diff --git a/compose.metrics.yml b/compose.metrics.yml new file mode 100644 index 0000000..35765fb --- /dev/null +++ b/compose.metrics.yml @@ -0,0 +1,7 @@ +version: "3.8" +services: + app: + environment: + - METRICS_ENABLED + ports: + - "8082:8082" diff --git a/traefik.yml.tmpl b/traefik.yml.tmpl index 59e7c39..b734a8a 100644 --- a/traefik.yml.tmpl +++ b/traefik.yml.tmpl @@ -67,6 +67,9 @@ entrypoints: {{ if eq (env "METRICS_ENABLED") "1" }} metrics: address: ":8082" + http: + middlewares: + - basicauth@file {{ end }} {{ if eq (env "MATRIX_FEDERATION_ENABLED") "1" }} matrix-federation: @@ -80,6 +83,8 @@ ping: metrics: prometheus: entryPoint: metrics + addRoutersLabels: true + addServicesLabels: true {{ end }} certificatesResolvers: