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

Add new endpoint to expose lag #137

Merged
merged 12 commits into from
May 22, 2023
Merged

Add new endpoint to expose lag #137

merged 12 commits into from
May 22, 2023

Conversation

yzang2019
Copy link
Contributor

@yzang2019 yzang2019 commented May 16, 2023

Describe your changes and provide context

Problem:
AWS ELB/ALB required health check endpoint to respond a non 200 response to indicate the service is not healthy. This is currently not available for RPC nodes.

Solution:
We will add a new endpoint /lag_status, which will respond a 200 OK when lag is below lag-threshold, and will respond with a non 200 status code when lag is above the lag threshold. In that way, we can easily configure ALB to detect the health of an RPC node

Testing performed to validate your change

image

@Kbhat1
Copy link
Contributor

Kbhat1 commented May 17, 2023

Could we add unit tests to config_test.go for config changes (just validating lag is set properly) and tests for functionality in internal/rpc/core/lag_status.go. Otherwise LGTM

@yzang2019
Copy link
Contributor Author

yzang2019 commented May 22, 2023

Could we add unit tests to config_test.go for config changes (just validating lag is set properly) and tests for functionality in internal/rpc/core/lag_status.go. Otherwise LGTM

There seems to be no easy way to test lag_status with unit test since we can't mock Reactor object. Just tested with integration test and works properly.

@yzang2019 yzang2019 merged commit 2bcae6b into main May 22, 2023
Timwood0x10 pushed a commit to Timwood0x10/sei-tendermint that referenced this pull request Jun 7, 2023
## Describe your changes and provide context
`seid status` fails for non-validator nodes. It turns out that the check
for `ValidatorInfo.Pubkey` here
https://github.com/cosmos/cosmos-sdk/blob/main/client/rpc/status.go#L52
isn't in our branch, which causes it to fail with a nil pointer.
## Testing performed to validate your change
Verified and tested on rpc node:
```
/home/ubuntu/sei-chain# seid status | jq
{
  "NodeInfo": {
    "protocol_version": {
      "p2p": "8",
      "block": "11",
...
```
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.

3 participants