forked from coop-cloud/traefik
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f946692234
|
||
|
|
063e6b4a5a |
+6
-2
@@ -139,10 +139,14 @@ WRITE_TIMEOUT=0s
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
## Enable prometheus metrics collection
|
## Enable prometheus metrics collection
|
||||||
## used used by the coop-cloud monitoring stack
|
## Metrics are served unauthenticated on :8082, reachable only from
|
||||||
## BASIC_AUTH should also be enabled
|
## other services on the proxy network (e.g. monitoring-ng's Alloy,
|
||||||
|
## which auto-discovers it via the prometheus.io/scrape label)
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
|
||||||
#METRICS_ENABLED=1
|
#METRICS_ENABLED=1
|
||||||
|
|
||||||
|
## Setting METRICS_FQDN also adds a public metrics endpoint (behind
|
||||||
|
## basic auth). BASIC_AUTH should be enabled for this.
|
||||||
#METRICS_FQDN=metrics.traefik.example.com
|
#METRICS_FQDN=metrics.traefik.example.com
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export TRAEFIK_YML_VERSION=v32
|
export TRAEFIK_YML_VERSION=v33
|
||||||
export FILE_PROVIDER_YML_VERSION=v12
|
export FILE_PROVIDER_YML_VERSION=v13
|
||||||
export ENTRYPOINT_VERSION=v5
|
export ENTRYPOINT_VERSION=v5
|
||||||
export ANUBIS_YML_VERSION=v1
|
export ANUBIS_YML_VERSION=v1
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ services:
|
|||||||
- "traefik.http.middlewares.anubis.forwardauth.address=http://anubis:8080/.within.website/x/cmd/anubis/api/check"
|
- "traefik.http.middlewares.anubis.forwardauth.address=http://anubis:8080/.within.website/x/cmd/anubis/api/check"
|
||||||
- "traefik.http.middlewares.anubis.forwardauth.trustForwardHeader=true"
|
- "traefik.http.middlewares.anubis.forwardauth.trustForwardHeader=true"
|
||||||
anubis:
|
anubis:
|
||||||
image: "ghcr.io/techarohq/anubis:v1.26.2"
|
image: "ghcr.io/techarohq/anubis:v1.27.0"
|
||||||
environment:
|
environment:
|
||||||
BIND: ":8080"
|
BIND: ":8080"
|
||||||
TARGET: " "
|
TARGET: " "
|
||||||
|
|||||||
@@ -3,3 +3,9 @@ services:
|
|||||||
app:
|
app:
|
||||||
environment:
|
environment:
|
||||||
- METRICS_ENABLED
|
- METRICS_ENABLED
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
# lets monitoring-ng's Alloy auto-discover and scrape metrics-internal
|
||||||
|
# via the proxy network.
|
||||||
|
- "prometheus.io/scrape=true"
|
||||||
|
- "prometheus.io/port=8082"
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ http:
|
|||||||
stsSeconds: "31536000"
|
stsSeconds: "31536000"
|
||||||
{{ if eq (env "METRICS_ENABLED") "1" }}
|
{{ if eq (env "METRICS_ENABLED") "1" }}
|
||||||
routers:
|
routers:
|
||||||
|
{{ if ne (env "METRICS_FQDN") "" }}
|
||||||
traefik-metrics:
|
traefik-metrics:
|
||||||
rule: "Host(`{{ env "METRICS_FQDN" }}`)"
|
rule: "Host(`{{ env "METRICS_FQDN" }}`)"
|
||||||
entrypoints:
|
entrypoints:
|
||||||
@@ -41,6 +42,14 @@ http:
|
|||||||
middlewares:
|
middlewares:
|
||||||
- basicauth@file
|
- basicauth@file
|
||||||
service: prometheus@internal
|
service: prometheus@internal
|
||||||
|
{{ end }}
|
||||||
|
# reachable from other services on the proxy network only (this port
|
||||||
|
# isn't published to the host), without auth
|
||||||
|
traefik-metrics-internal:
|
||||||
|
rule: "PathPrefix(`/`)"
|
||||||
|
entrypoints:
|
||||||
|
- metrics-internal
|
||||||
|
service: prometheus@internal
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
tls:
|
tls:
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
1. compose.metrics.yml now adds prometheus.io/scrape labels so services like monitoring-ng can automatically discover and scrape Traefik's metrics.
|
||||||
@@ -112,6 +112,10 @@ entrypoints:
|
|||||||
onion:
|
onion:
|
||||||
address: ":9052"
|
address: ":9052"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if eq (env "METRICS_ENABLED") "1" }}
|
||||||
|
metrics-internal:
|
||||||
|
address: ":8082"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
ping:
|
ping:
|
||||||
entryPoint: web
|
entryPoint: web
|
||||||
|
|||||||
Reference in New Issue
Block a user