Skip to content

Improve health check for wallet backend services #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

aditya1702
Copy link
Contributor

@aditya1702 aditya1702 commented Jul 21, 2025

What

  • Update the health check to also check for RPC health and the difference between the wallet-backend latest ledger and RPC latest ledger
  • Add a health check endpoint to the ingest server.
  • Update docker-compose file so that when running integration tests, we start the ingest service directly from the RPC latest ledger instead of backfilling historical ledgers.

Why

We spin up the API and Ingest services separately in our kubernetes environment. The ingest service needs a health check endpoint so that the readiness probe for kube can be configured to check for ingest service health.

Known limitations

N/A

Checklist

PR Structure

  • It is not possible to break this PR down into smaller PRs.
  • This PR does not mix refactoring changes with feature changes.
  • This PR's title starts with name of package that is most changed in the PR, or all if the changes are broad or impact many packages.

Thoroughness

  • This PR adds tests for the new functionality or fixes.
  • All updated queries have been tested (refer to this check if the data set returned by the updated query is expected to be same as the original one).

Release

  • This is not a breaking change.
  • This is ready to be tested in development.
  • The new functionality is gated with a feature flag if this is not ready for production.

@aditya1702 aditya1702 changed the title Add a /health endpoint to the ingest server Improve health check for wallet backend services Jul 21, 2025
@aditya1702 aditya1702 requested a review from JakeUrban July 21, 2025 22:13
Copy link
Collaborator

@marcelosalloum marcelosalloum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Plz, feel free to merge it after addressing the comments below.

Comment on lines +29 to +33
rpcHealth, err := h.RPCService.GetHealth()
if err != nil {
httperror.InternalServerError(ctx, "", err, nil, h.AppTracker).Render(w)
return
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reaching RPC every time might not be the best approach here.

Can we use something like a 1-minute cache here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I dont think it should be an issue here since its a health check and it doesnt impact any other wallet-backend operation. Are you thinking it would slow down requests from RPC side? I assume it can handle multiple health requests and also other endpoint requests? cc @Shaptic @2opremio any thoughts here?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s definitely fine to have this be in parallel with other requests. In fact I’m fairly certain this is exactly what happens in our k8s deployment. I’d recommend wrapping the message in the returned error, though, for verbosity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants