InfluxDB2 Metrics, Static config and env variables

I'm trying to set the InfluxDB2 token and org via the following env variables:


These are set in a .env file loaded from the docker-compose yaml file

the traefik.yml static config file has:

    address: http://influxdb:8086
    bucket: "traefik_bucket"
    addEntryPointsLabels: true
    addServicesLabels: true
    pushInterval: 10s

If I run docker exec -it traefik /bin/sh and then execute "env", it returns


However, Traefik logs:

level=error msg="token, org or bucket property is missing" metricsProviderName=influxdb2

How can I fix this? I don't want to add the actual token to the static config file. I would like to be able to specify that in the env file so that it is set when the container is created and loaded.

Thank you in advance

The error mentions bucket also. Try adding that ?

Caveat: I haven't used influxdb with treafik metrics.

@cakiwi Thank you.

I've already tried that but still got the same error.

Hi all
Just reading "Traefik Configuration Documentation - Traefik"
specifically the part about static configuration
It says that the options are mutually exclusive (i.e. you can use only one at the same time)

Does this mean that because the static file contains:

    address: http://influxdb:8086

That the rest of the options will not be taken from the env variables?

I'm a little confused because this looks like a bug to me. I can understand why it would ignore the values in the env variable IF the static file already contains a value for "Token" for example but not if the option is not there!

Any devs reading this willing to shed some light?

Thank you in advance