Description
Component(s)
receiver/dockerstats
Is your feature request related to a problem? Please describe.
The dockerstatsreceiver
by default uses unix:///var/run/docker.sock
. Although the configuration supports overridding the endpoint
with something other than the default, it should not be necessary to specify the endpoint explicitly when the environment variable DOCKER_HOST
has been defined, pointing to the correct location.
Note that the Docker documentation defines DOCKER_HOST
as the "Daemon socket to connect to":
There may be certain environments where the environment variable DOCKER_HOST
has been set correctly to a non-standard endpoint and where it is difficult to modify the dockerstatsreceiver
config. For those situations, respecting DOCKER_HOST
for the default endpoint would be ideal.
Describe the solution you'd like
The docker endpoint should be resolved in the following order:
- The value of
endpoint
if it is set in the YAML config for the receiver. - The value of the environment variable
DOCKER_HOST
if it is set. - The fallback constant value of
unix:///var/run/docker.sock
Describe alternatives you've considered
Run a script to modify the endpoint
in the YAML from the ${DOCKER_HOST}
value.
Additional context
No response