I'm deploying with swarm, and providing static config via CLI flags to the service container command, and dynamic config via labels. I'm not seeing any traefik_service*
metrics at all, but can see all other types, e.g. traefik_entrypoint*
metrics. Further, labels for internal services only are showing up in my metrics (prometheus@internal and noop@internal), whereas I have multiple other services (which I didn't include below).
I'm using a dedicated metrics entrypoint, but I also tried exposing them on my main web entrypoint, where are my services are exposed, and got the same result.
To be clear, my metrics setup is working, but service metrics themselves (not just service labels, which have enabled) are completely missing.
compose.yml
services:
traefik:
networks:
- triviaties_production_network
logging: *default-logging
image: traefik:2.11
volumes:
- triviaties_production_traefik:/etc/traefik/acme
- /var/run/docker.sock:/var/run/docker.sock:ro
# this may eventually be used if we use Traefik's offical documented Swarm endpoint instead
# of bind mounting the docker socket
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '0.0.0.0:80:80'
- '0.0.0.0:443:443'
# metrics
- '0.0.0.0:8082:8082'
command: >
--log.level=INFO
--accesslog=true
--providers.docker.watch=true
--providers.docker=true
--providers.docker.swarmMode=true
--providers.docker.exposedByDefault=false
--entrypoints.metrics.address=:8082
--entrypoints.web.address=:80
--entrypoints.web.http.redirections.entrypoint.to=web-secure
--entrypoints.web-secure.address=:443
--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=route53
--certificatesresolvers.letsencrypt.acme.email=redact
--certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json
--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web
--api=true
--api.dashboard=true
--metrics=true
--metrics.prometheus=true
--metrics.prometheus.addEntryPointsLabels=true
--metrics.prometheus.addRoutersLabels=true
--metrics.prometheus.addServicesLabels=true
--metrics.prometheus.entryPoint=metrics
deploy:
labels:
- 'traefik.enable=true'
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager