[GH-ISSUE #3830] [feature]: add health check checking the DB connection #1343

Closed
opened 2026-03-16 19:55:31 +03:00 by kerem · 4 comments
Owner

Originally created by @RaHehl on GitHub (Feb 15, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3830

Is there an existing issue for this?

  • I have searched the existing issues

Summary

I need a health check that also checks whether the database is accessible.
The current "ping" does not check whether the DB is reachable packages/hoppscotch-backend/src/app.controller.ts

A simple SELECT 1 would be enough

I currently have the problem that Hoppscotch is no longer accessible when the DB credentials are updated automatically, and the health check does not activate the new ones by restarting the pod because the health check is still successful.

Why should this be worked on?

see above

Originally created by @RaHehl on GitHub (Feb 15, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3830 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Summary I need a health check that also checks whether the database is accessible. The current "ping" does not check whether the DB is reachable packages/hoppscotch-backend/src/app.controller.ts A simple SELECT 1 would be enough I currently have the problem that Hoppscotch is no longer accessible when the DB credentials are updated automatically, and the health check does not activate the new ones by restarting the pod because the health check is still successful. ### Why should this be worked on? see above
kerem 2026-03-16 19:55:31 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@Shub3am commented on GitHub (Feb 16, 2024):

Can i work on this?

<!-- gh-comment-id:1947836164 --> @Shub3am commented on GitHub (Feb 16, 2024): Can i work on this?
Author
Owner

@balub commented on GitHub (Apr 29, 2024):

@RaHehl Could you give us more clarity on the expectations of this feature.

Please feel free to correct me if I got this wrong, but do you want the current /ping route also run a simple "SELECT 1` query against the DB to check if the backend instance can communicate with the DB, even after the DB creds change?

<!-- gh-comment-id:2081944067 --> @balub commented on GitHub (Apr 29, 2024): @RaHehl Could you give us more clarity on the expectations of this feature. Please feel free to correct me if I got this wrong, but do you want the current `/ping` route also run a simple "SELECT 1` query against the DB to check if the backend instance can communicate with the DB, even after the DB creds change?
Author
Owner

@RaHehl commented on GitHub (Apr 29, 2024):

@balub
this does not necessarily have to be /ping, e.g. /health would be OK too.
The health check currently does not check whether the backend can establish a connection to the database.

Perhaps a clean solution would be to integrate Terminus, as described in the NestJS example:

https://docs.nestjs.com/recipes/terminus#healthchecks-terminus

https://github.com/nestjs/terminus/blob/master/sample/012-prisma-app/src/health/health.controller.ts

<!-- gh-comment-id:2081969183 --> @RaHehl commented on GitHub (Apr 29, 2024): @balub this does not necessarily have to be /ping, e.g. /health would be OK too. The health check currently does not check whether the backend can establish a connection to the database. Perhaps a clean solution would be to integrate Terminus, as described in the NestJS example: https://docs.nestjs.com/recipes/terminus#healthchecks-terminus https://github.com/nestjs/terminus/blob/master/sample/012-prisma-app/src/health/health.controller.ts
Author
Owner

@balub commented on GitHub (Apr 29, 2024):

@RaHehl understood, I just wanted to make sure we were on the same page when talking about we wanted a way to check if the backend can talk to the database. We will look into Terminus looks promising.

<!-- gh-comment-id:2081972819 --> @balub commented on GitHub (Apr 29, 2024): @RaHehl understood, I just wanted to make sure we were on the same page when talking about we wanted a way to check if the backend can talk to the database. We will look into Terminus looks promising.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1343
No description provided.