Skip to content

Conversation

@seniakalma
Copy link
Collaborator

Motivation

When Zebra runs in different orchestration systems (ECS, K8s), and when oad balancers route traffic to it there's a need for simple HTTP probes to avoid routing traffic to un-healthy nodes, and Zebra has no readiness/liveness HTTP checks to validate this.

Closes ZcashFoundation#8830.

Solution

Use the current JSON RPC (RPSEE) server and add a simple GET health endpoint to it that returns the following details:
curl -s http://127.0.0.1:8232/health
response:
{ "status": "healthy", "version": "1.0.0-beta.41", "git_tag": "v1.0.0-rc.1", "git_commit": "75397cd59d0bac4b4c1e71187bb8af7494efb8b4", "timestamp": "2025-09-02T22:35:14.756599+00:00" }

Tests

A manual test of running the node locally and checking that the endpoint returns the health information correctly for a GET request for /health
In addition to that, those 2 snapshots tests were added:

Testnet test (get_health_info_status@testnet_10.snap)
Checks that calling get_health_info_status on testnet also returns:
{ "status": "healthy" }

Follow-up Work

Possible to add or adapt any information returned for that request.

PR Checklist

  • The PR name is suitable for the release notes.
  • The PR follows the contribution guidelines.
  • The library crate changelogs are up to date.
  • The solution is tested.
  • The documentation is up to date.

@seniakalma seniakalma requested a review from PaulLaux September 25, 2025 09:35
@seniakalma seniakalma self-assigned this Sep 25, 2025
@seniakalma seniakalma changed the title Add all code changes Add health-check to Zebra Oct 2, 2025
@seniakalma seniakalma changed the title Add health-check to Zebra Add health-check to Zebra (jsonrpsee based) Oct 2, 2025

// Give enough time to start connecting to some peers.
std::thread::sleep(Duration::from_secs(10));
std::thread::sleep(LAUNCH_DELAY);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The previous 10 second wait wasn't enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant