Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the environment variable DOCKER_HOST in resolving the endpoint #35779

Open
michaelsafyan opened this issue Oct 14, 2024 · 1 comment
Open
Labels
enhancement New feature or request needs triage New item requiring triage receiver/dockerstats

Comments

@michaelsafyan
Copy link
Contributor

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:

  1. The value of endpoint if it is set in the YAML config for the receiver.
  2. The value of the environment variable DOCKER_HOST if it is set.
  3. 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

@michaelsafyan michaelsafyan added enhancement New feature or request needs triage New item requiring triage labels Oct 14, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage receiver/dockerstats
Projects
None yet
Development

No branches or pull requests

1 participant