Metrics with prometheus is not working

Hey there,

I'm running traefik with docker-compose and have a metrics rule (through a file) set up like this:

entryPoints:
  metrics:
    address: ":5443"

http:
  routers:
    metrics:
      entrypoints: https
      rule: Path(`/metrics`)
      service: prometheus@internal
      middlewares: auth@file

services:
  metrics:
    loadbalancer:
      server:
        port: 5443

metrics:
  prometheus:
    entryPoint: metrics
    manualRouting: true

However, metrics are not working. I have this message in the logs:

traefik_v2 | time="2020-09-29T16:59:04Z" level=error msg="prometheus is not enabled" entryPointName=https routerName=metrics@file

I also tried a much simpler config like this one from the docs with no luck either:

metrics:
  prometheus: {}

Looks like you are mixing static and dynamic configuration in the same file.

The router and service need to be in a file provider and the static configuration in the traefik.yaml.

Awesome, that worked! Thanks for the quick help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.