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
Support for Windows containers #4666
Comments
@olljanat That would be great if you could look into this. I haven't researched this at all but the main question I have is if the image would have to be built on a Windows machine or if it can be created from Linux. |
@danielnelson it need to be created on Windows. That is only way. Btw. Is there some reason that Docker client is set to use 1.21 version instead of some newer one? (https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/client.go#L14) |
The docker client is set to 1.21 to support older docker versions. Iirc, it will still work with newer server versions, let me know if you find differently. |
We are hitting this issue with version
Interestingly it looks like it was using Would it be possible to get this version to be configurable? |
Btw. We decided to not use Telegraf so I will not implement this one. |
As a workaround, you should be able to use the environment configuration to manually set the api version, in your environment set these variables as needed:
Then use
We should investigate if we can use |
Hi, @danielnelson. Suggested workaround not worked for me, seems like env variables DOCKER_HOST/DOCKER_API_VERSION ignored by telegraf service. |
Docker code very clearly sets minimum API version for Windows to 1.24 https://github.com/moby/moby/blob/8e610b2b55bfd1bfa9436ab110d311f5e8a74dcb/api/common_windows.go#L8 co you cannot override that. Also notice that oldest supported Docker version is 17.06 and that contains already API version 1.30. |
@TerraVenil Looked over the code and it seems like it should work, and definitely working in Linux. Can you double check the environment variables are set when Telegraf is ran? If you are running Telegraf as a service you may need to set it explicitly for the service. It may be simpler to test from a cmd window. |
@danielnelson let me provide additional info about env. I use Telegraf as a service from Windows Container to grab Docker host metrics.
Windows Container
2019-01-15T11:27:40Z E! [inputs.docker]: Error in plugin: error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. From another point if I use
I received as expected |
By using |
@hoerup try set environment variable DOCKER_API_VERSION=1.24 |
Got it working with changing https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/client.go#L14 to 1.24 and building a new binary |
Did fix it for 1.15.0 ? |
@wyaopeng still broken |
How can this issue still be open 3 years later? |
Did fix it now ? |
Telegraf manually sets the API version in the docker client. We are using the 20.10 version of docker, which cooresponds to a newer API version that we can bump up to. Fixes: influxdata#4666 Fixes: influxdata#10380
Feature Request
Currently containerized version of Telegraf is only available for Linux and it would be very useful to have it for native Windows containers too.
Proposal:
Use case:
Windows container host monitoring.
Extra comments
I can start look this one but let me know if you have any requirements/comments how you want it to be implemented.The text was updated successfully, but these errors were encountered: