telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

Docker healthcheck

Open modem7 opened this issue 5 years ago • 4 comments

Feature Request

Please include a docker healthcheck for telegraf so that we can use systems like autoheal to restart in case of failure

Proposal:

Current behavior:

Container stops if it fails

Desired behavior:

Healthcheck would allow container to come up as healthy/unhealthy and have it be dealt with accordingly.

Use case:

As an example: After a reboot, telegraf came up before other services:

image

With a docker healthcheck option, we'd be able to have the container restart and have it come up as healthy.

modem7 avatar Jan 14 '21 23:01 modem7

next steps: need to determine what cmd to run to verify health of telegraf while in a container and then update the dockerfiles we use to include the HEALTHCHECK option

powersj avatar Mar 29 '22 20:03 powersj

next steps: need to determine what cmd to run to verify health of telegraf while in a container and then update the dockerfiles we use to include the HEALTHCHECK option

Something like this, with the right use case, would probably be perfect, depending how it works, and more specifically, how we can reference it in Docker.

https://community.influxdata.com/t/telegraf-outputs-health-example/10302

From my understanding, the config needs creating first, which is the main issue I can see being a roadblock, unless we enable it via some form of environmental variable/enable it as default in the image.

modem7 avatar Mar 29 '22 20:03 modem7