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

Docker input doesn't parse image names correctly #5835

Closed
jcmcken opened this issue May 11, 2019 · 0 comments · Fixed by #5838
Closed

Docker input doesn't parse image names correctly #5835

jcmcken opened this issue May 11, 2019 · 0 comments · Fixed by #5838
Labels
area/docker bug unexpected problem or unintended behavior
Milestone

Comments

@jcmcken
Copy link
Contributor

jcmcken commented May 11, 2019

Relevant telegraf.conf:

It's not really relevant, but:

[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
gather_services = false
perdevice = false
total = true

System info:

Telegraf 1.9.1 (git: HEAD 2063609)
Docker 18.09.4, build d14af54266

Steps to reproduce:

  1. Run a container from a private registry on a specific port, but without a tag, e.g. docker run -d repo.example.com:9003/postgres (no :latest or any other tag, which is a valid way to run a container)
  2. Start Telegraf with the Docker input.
  3. Run telegraf --config <file> --test --input-filter docker and observe the output.

Expected behavior:

The container_image should be repo.example.com:9003/postgres and the container_version should be latest (since no tag was specified).

Actual behavior:

The metrics will show the container_image as repo.example.com and the container_version as 9003/postgres.

Additional info:

The image parsing logic is here, and does not account for the case where the registry URL includes a port and no tag is present in the image name.

@glinton glinton added area/docker bug unexpected problem or unintended behavior labels May 13, 2019
@danielnelson danielnelson added this to the 1.11.0 milestone May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants