mongodb_exporter icon indicating copy to clipboard operation
mongodb_exporter copied to clipboard

Health check for Docker container

Open Andy-Voigt opened this issue 3 years ago • 3 comments

Hello,

it would be nice to have ### curl installed in this image to have a health check for docker.

Regards, Andy

Andy-Voigt avatar Nov 12 '21 12:11 Andy-Voigt

I wonder if we just could add it as option to mongodb_exporter itself. To not add additional binaries/layers to the container we could leverage libs that we already have inside the exporter and just check connection by simple http request, or implement some other way of health checking (rpc connection, signal, whatever).

k8s has external livenessProbe/readinessProbe which looks better and doesn't require additional func.

denisok avatar Nov 17 '21 13:11 denisok

The health check in docker must be a command inside the container. Any liveniss command with a return of 0 or 1 would be perfect.

Andy-Voigt avatar Nov 17 '21 19:11 Andy-Voigt

yep, like mongodb_exporter --isalive or something like that ) so that would be one binary in a container

denisok avatar Nov 18 '21 10:11 denisok