Dynamic content into static configuration

I am trying to configure tracing in my Traefik container but the endpoint will change depending on the environment I am working in. I am currently using a traefik.yml for static configuration, which makes it so that the tracing endpoint must be a fixed value in this static config. I cannot do something like:

tracing:
  otlp:
    http:
      endpoint: `{{ env "OTEL_URL"}}`

I can also not use CLI args because I'm already using a static yml file, so no
--tracing.otlp.http.endpoint=$OTEL_URL

What other options do I have here? This seems like a reasonable use case so I'm surprised with how limiting this is. I can have a placeholder value for the endpoint in static config and replace it during the build but that's a last resort.

In my 4 years here in the community forum, you are the first one asking for this, so it seems like a very niche use case :wink:

You could use any kind of yaml preprocessing in terraform/ansible/etc to create the desired config.