pufferpanel / pufferpanel

PufferPanel is an open source game server management panel, designed for both small networks and personal use

Home Page:https://pufferpanel.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Health check endpoint

LabodiDavid opened this issue · comments

Is your feature request related to a problem? Please describe.

I'm running pufferpanel in docker and planning to monitor the health status of the container and I ran into the fact that there is no dedicated solution or an endpoint to check for the service health.

Describe the solution you'd like

A /health endpoint would be useful, both in a normal environment and in a docker environment for monitoring.
It should check the connection state of the database, the daemon, and any other aspects that consider pufferpanel to be in a healthy state.

Describe alternatives you've considered
Currently, I'm checking the container's health like this:

healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080"]
      interval: 30s
      retries: 3
      timeout: 10s

However, this is unreliable because, for example, it may report a healthy status even if it doesn't reach the database.

The issue is that in the grand scheme of how healthchecks should work, that is exactly what it should be.

If you are doing checks like this, ideally, you'd actually move the database to be it's own container, and so it would have it's own healthcheck. Which ensures that the DB part of the "service" is online.

I don't really want to add a method that does DB calls that isn't behind auth or otherwise requires specific data to get past. While this won't hurt anything, it's not ideal.