hey just a quick question about health checks. The...
# talk-kratos
d
hey just a quick question about health checks. The
/health/ready
endpoint is supposed to be checking the database connection status, at least according to the docs. I’m currently watching a self hosted Kratos return 500 errors for every request, with the logs saying:
An error occurred while handling a request audience=application error=map[message:unable to fetch records: failed to connect to DATABASE
However,
/health/ready
is still returning:
Copy code
{
  "status": "ok"
}
Is there something I’m missing here? It seems like Kratos health status isn’t actually doing a check on database connectivity. There’s also
/health/alive
, which again according to the docs just checks that Kratos is responsive to requests. We really need Kratos to return a health error if it can’t connect to the database.
ok so looking further into this, what I am seeing is because: • Kratos’ ready health check uses
Ping()
from the database package • The underlying Ping() for postgres just attempts to connect and send an empty query, essentially just checking any connectivity is present I wonder whether Kratos should be doing health check with something more specific, eg at least trying to query something on Kratos’ database, not just connection to the server?