Add environment config for metrics.statsd
It would be beneficial to have an environment variable that can override the metrics statsd endpoint. This would allow for more flexible configurations in different environments without needing to change the configuration file directly.
With the latest release you can use environment variable references in the config (it's just not yet documented).
Setting the endpoint to a variable in the format ${STATSD_ENDPOINT} will read it from the environment variable STATSD_ENDPOINT.
I tried using that environment variable however it still isn't working
RELAY_MODE=proxy STATSD_ENDPOINT=127.0.0.1:8125 ./relay run --log-level debug
does not output the log line INFO relay_statsd: reporting metrics to statsd at 127.0.0.1:8125 compared to when I set it in config.yml
Did you also set the reference in the config as mentioned?
metrics:
statsd: "${STATSD_ENDPOINT}"
prefix: relay
...
I did not try use that format, I was attempting to set up the relay with no config file, rather using environment variables to configure it entirely, this is so that I can use the default docker image without having to mount any volumes or rebuild a custom image with the config file hard baked into it.
I'd be surprised if you get away without having the need for a file, it depends a bit on what mode you configure but very likely you'll always need to have credentials or at least some properties configured.
Closing, as this should work already.