If metrics prometheus manualRouting is false, how can I get access to metrics?

Traefik metrics manualRouting

Pre

I know how to get access to metrics by this config:

https://traefik.x.internal/metrics, this works fine.

Question

However, I don't know the meaning of the parameter manualRouting, If set true, only this one disappeared

As I understand it, if it's set to false, I don't need to configure the metrics router myself, I can just pass it through https://traefik.x.internal/metrics. But it doesn't work, if not configure metrics router

Static Configuration

### Static Configuration
log:
    level: INFO
api:
    dashboard: true
providers:
    file:
        directory: /etc/traefik/dynamic-conf
        watch: true
entryPoints:
    web:
        address: :80
        http:
            redirections:
                entryPoint:
                    to: websecure
                    scheme: https
                    permanent: true
    websecure:
        address: :443
    metrics:
        address: :8082
metrics:
    prometheus:
        entryPoint: metrics

Dynamic Configuration

### Dynamic Configuration
tls:
    certificates:
        -   certFile: /certs/cert.pem
            keyFile: /certs/key.pem
http:
    routers:
        dashboard:
            rule: Host(`traefik.x.internal`)
            service: api@internal
            tls: { }
        metrics:
            rule: Host(`traefik.x.internal`) && PathPrefix(`/metrics`)
            service: prometheus@internal
            tls: { }

I think when you set manualRouting to true, then you need to create your own router with service prometheus@internal (doc). Otherwise the router is created automatically with path /metrics.

Default entrypoint is traefik on port 8080, you can also overwrite that (doc).

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