TwiN / gatus

⛑ Automated developer-oriented status page

Home Page:https://gatus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gatus in Docker Container Healthcheck

Nbelles opened this issue · comments

Describe the feature request

I would like to see a healthcheck when running gatus in a docker container, specifically I want to see healthy next to the container uptime when running docker ps. I tried my hand at implementing it myself but wasn't able to come up with a clean solution without modifying the dockerfile.

Because the gatus binary is copied into a scratch docker container, there aren't any other binaries to use to run the healthcheck on (common things like curl/wget/etc.). I tried copying a curl binary into the container so I could capture the json at the /health endpoint but then I didn't have any tools like grep to check the data that comes back.

If you wanted to keep everything in the binary, you could add an optional argument (like gatus --health) that causes gatus to simply return the same status that is generated from the /health endpoint (return 0 for UP and return 1 for DOWN).

Why do you personally want this feature to be implemented?

By seeing the health status of gatus in docker, I can better determine the status of the gatus container along with all the other containers I am running.

How long have you been using this project?

Just started.

Additional information

Thanks!

commented

I built Gatus with a "fail fast" mechanism in mind. This means that if something is wrongly configured, it'll fail on start.

I guess an issue that could lead to this is if access to the database suddenly stopped working, but even so, right now, Gatus' health status does not change from up to down if that happens, so this wouldn't be useful.

Perhaps when that's implemented, this could be worth implementing, but for now, I don't see the value.

Regardless, thank you for creating an issue!