Skip to content
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

[sui-node] Add heath check router to jsonrpc server #19433

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

johnjmartin
Copy link
Contributor

@johnjmartin johnjmartin commented Sep 18, 2024

Description

Copying over the health check from the https://github.com/MystenLabs/sui/blob/main/crates/sui-rest-api/src/health.rs into a route that's enabled by default on the fullnode.

This should be removed once the REST api is enabled for all fullnodes

Test plan

tested locally

usage example (on a local sui-node starting from genesis):

$ curl localhost:9000/health 
up%                                                                                                                                                      
$ curl 'localhost:9000/health?threshold_seconds=10000'
down%                                                                                                                                                    
$ curl 'localhost:9000/health?threshold_seconds=1000000000'
up%                                                                                                                           

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC: Feature: Adds a configurable health check endpoint for JSON RPC Full nodes to report as being down if too far behind.
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Sep 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 7:16pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Sep 20, 2024 7:16pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Sep 20, 2024 7:16pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Sep 20, 2024 7:16pm

fixup: remove unnecessary metrics loop
Copy link
Contributor

@bmwill bmwill left a comment

Choose a reason for hiding this comment

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

Looks awesome! Can you clean up the PR cover letter since its now outdated vs what the change actually does now?

@johnjmartin johnjmartin merged commit 17aebf1 into MystenLabs:main Sep 20, 2024
43 of 44 checks passed
@johnjmartin johnjmartin deleted the fullnode-healthchecks branch September 20, 2024 20:59
johnjmartin added a commit to johnjmartin/sui that referenced this pull request Sep 20, 2024
## Description 

Copying over the health check from the
https://github.com/MystenLabs/sui/blob/main/crates/sui-rest-api/src/health.rs
into a route that's enabled by default on the fullnode.

This should be removed once the REST api is enabled for all fullnodes 

## Test plan 

tested locally

usage example (on a local sui-node starting from genesis):
```
$ curl localhost:9000/health 
up%                                                                                                                                                      
$ curl 'localhost:9000/health?threshold_seconds=10000'
down%                                                                                                                                                    
$ curl 'localhost:9000/health?threshold_seconds=1000000000'
up%                                                                                                                           
```
---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [x] JSON-RPC: feature: adds a configurable health check endpoint for
json rpc fullnodes to report down if too far behind
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
johnjmartin added a commit that referenced this pull request Sep 20, 2024
## Description 

cherry pick of #19433
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.

2 participants