feat(bento-api): add health check endpoint #1031
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The reason for adding a health endpoint is to enable monitoring and orchestration systems (like Kubernetes, load balancers, and monitoring tools) to verify that our service can actually communicate with its critical dependencies before routing traffic to it. Without this, a service might appear "running" but be unable to serve requests due to database or storage failures.
This PR implements a
/health
endpoint that monitors the status of external dependencies: PostgreSQL and S3/MinIO storage.Changes Made
/health
that returns JSON status for all servicesbucket_exists()
methodHealth Response Format
Test
To test the health endpoint:
Open Question for Maintainers
Should we also include Redis health checks in this endpoint? The current implementation focuses on the core dependencies (Postgres + S3), but Redis support could be added as an optional service if it's part of the infrastructure. This would require:
AppState
Please advise if Redis monitoring should be included in this PR or handled separately.