-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[GraphQL] Add health endpoint #18277
Merged
stefan-mysten
merged 2 commits into
MystenLabs:main
from
stefan-mysten:gql_health_endpoint
Jun 25, 2024
Merged
[GraphQL] Add health endpoint #18277
stefan-mysten
merged 2 commits into
MystenLabs:main
from
stefan-mysten:gql_health_endpoint
Jun 25, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stefan-mysten
requested review from
amnn,
wlmyng,
emmazzz and
suiwombat
as code owners
June 15, 2024 18:39
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@stefan-mysten is attempting to deploy a commit to the Mysten Labs Team on Vercel. A member of the Team first needs to authorize it. |
amnn
approved these changes
Jun 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
stefan-mysten
force-pushed
the
gql_health_endpoint
branch
from
June 17, 2024 03:47
b1175d1
to
ce0210c
Compare
stefan-mysten
force-pushed
the
gql_health_endpoint
branch
from
June 18, 2024 01:11
ce0210c
to
4b0bd8e
Compare
stefan-mysten
force-pushed
the
gql_health_endpoint
branch
from
June 19, 2024 00:44
4b0bd8e
to
ceab528
Compare
stefan-mysten
force-pushed
the
gql_health_endpoint
branch
from
June 20, 2024 17:11
ceab528
to
c083459
Compare
stefan-mysten
force-pushed
the
gql_health_endpoint
branch
from
June 21, 2024 16:30
c083459
to
77960e1
Compare
7 tasks
wlmyng
added a commit
that referenced
this pull request
Jun 25, 2024
) ## Description Unblock #18277 by explicitly setting up the correct test scenario for the `test_query_default_page_limit` test. I think we can follow this up with 1. instead of using the same db url, follow sui-graphql-e2e-tests pattern and generate unique db urls for each test 2. this is so that we can run tests in parallel instead of sequentially (which is the case today due to the serial) 3. we can leverage ExecutorCluster.cleanup_resources to cleanup each test ## Test plan How did you test the new or updated feature? --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
…th check endpoint function
stefan-mysten
force-pushed
the
gql_health_endpoint
branch
from
June 25, 2024 00:25
77960e1
to
9e5b9a0
Compare
wlmyng
added a commit
that referenced
this pull request
Jun 25, 2024
) Unblock #18277 by explicitly setting up the correct test scenario for the `test_query_default_page_limit` test. I think we can follow this up with 1. instead of using the same db url, follow sui-graphql-e2e-tests pattern and generate unique db urls for each test 2. this is so that we can run tests in parallel instead of sequentially (which is the case today due to the serial) 3. we can leverage ExecutorCluster.cleanup_resources to cleanup each test How did you test the new or updated feature? --- 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Merged
14 tasks
wlmyng
added a commit
that referenced
this pull request
Jun 25, 2024
) Unblock #18277 by explicitly setting up the correct test scenario for the `test_query_default_page_limit` test. I think we can follow this up with 1. instead of using the same db url, follow sui-graphql-e2e-tests pattern and generate unique db urls for each test 2. this is so that we can run tests in parallel instead of sequentially (which is the case today due to the serial) 3. we can leverage ExecutorCluster.cleanup_resources to cleanup each test How did you test the new or updated feature? --- 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Merged
14 tasks
wlmyng
added a commit
that referenced
this pull request
Jun 25, 2024
…ault_page_limit (#18… (#18394) …393) Unblock #18277 by explicitly setting up the correct test scenario for the `test_query_default_page_limit` test. I think we can follow this up with 1. instead of using the same db url, follow sui-graphql-e2e-tests pattern and generate unique db urls for each test 2. this is so that we can run tests in parallel instead of sequentially (which is the case today due to the serial) 3. we can leverage ExecutorCluster.cleanup_resources to cleanup each test How did you test the new or updated feature? --- 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
stefan-mysten
added a commit
to stefan-mysten/sui
that referenced
this pull request
Jun 25, 2024
## Description Adds a `checkpoint_timestamp_ms` to the watermark task and uses it in a new health check endpoint function. The health endpoint checks for two things - if there is a DB connection, otherwise it returns code 500 - if the last known checkpoint timestamp is within an acceptable buffer. It subtracts the current timestamp from the checkpoint timestamp, and checks if the value is larger than the provided query param `max_checkpoint_lag_ms` or a default value, and it returns code 504, GATEWAY TIMEOUT in that case. How to query this endpoint: `curl -X GET "http://127.0.0.1:8000/health" -i ` Set the check for max checkpoint time lag to 10s. If it returns 503, then the checkpoint is behind. `curl -X GET "http://127.0.0.1:8000/health?max_checkpoint_lag_ms=10000" -i` ## Test plan Added a new test. `cargo nextest run --features pg_integration -- test_health_check` --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
stefan-mysten
added a commit
that referenced
this pull request
Jun 25, 2024
…24.4 release (#18399) ## Description Adds a `checkpoint_timestamp_ms` to the watermark task and uses it in a new health check endpoint function. The health endpoint checks for two things - if there is a DB connection, otherwise it returns code 500 - if the last known checkpoint timestamp is within an acceptable buffer. It subtracts the current timestamp from the checkpoint timestamp, and checks if the value is larger than the provided query param `max_checkpoint_lag_ms` or a default value, and it returns code 504, GATEWAY TIMEOUT in that case. How to query this endpoint: `curl -X GET "http://127.0.0.1:8000/health" -i ` Set the check for max checkpoint time lag to 10s. If it returns 503, then the checkpoint is behind. `curl -X GET "http://127.0.0.1:8000/health?max_checkpoint_lag_ms=10000" -i` ## Test plan Added a new test. `cargo nextest run --features pg_integration -- test_health_check` --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
wlmyng
added a commit
that referenced
this pull request
Jun 25, 2024
…fault_page_limit (#18… (#18395) …393) Unblock #18277 by explicitly setting up the correct test scenario for the `test_query_default_page_limit` test. I think we can follow this up with 1. instead of using the same db url, follow sui-graphql-e2e-tests pattern and generate unique db urls for each test 2. this is so that we can run tests in parallel instead of sequentially (which is the case today due to the serial) 3. we can leverage ExecutorCluster.cleanup_resources to cleanup each test How did you test the new or updated feature? --- 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
stefan-mysten
added a commit
to stefan-mysten/sui
that referenced
this pull request
Jul 9, 2024
Adds a `checkpoint_timestamp_ms` to the watermark task and uses it in a new health check endpoint function. The health endpoint checks for two things - if there is a DB connection, otherwise it returns code 500 - if the last known checkpoint timestamp is within an acceptable buffer. It subtracts the current timestamp from the checkpoint timestamp, and checks if the value is larger than the provided query param `max_checkpoint_lag_ms` or a default value, and it returns code 504, GATEWAY TIMEOUT in that case. How to query this endpoint: `curl -X GET "http://127.0.0.1:8000/health" -i ` Set the check for max checkpoint time lag to 10s. If it returns 503, then the checkpoint is behind. `curl -X GET "http://127.0.0.1:8000/health?max_checkpoint_lag_ms=10000" -i` Added a new test. `cargo nextest run --features pg_integration -- test_health_check` --- 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
tx-tomcat
pushed a commit
to tx-tomcat/sui-network
that referenced
this pull request
Jul 29, 2024
…tenLabs#18393) ## Description Unblock MystenLabs#18277 by explicitly setting up the correct test scenario for the `test_query_default_page_limit` test. I think we can follow this up with 1. instead of using the same db url, follow sui-graphql-e2e-tests pattern and generate unique db urls for each test 2. this is so that we can run tests in parallel instead of sequentially (which is the case today due to the serial) 3. we can leverage ExecutorCluster.cleanup_resources to cleanup each test ## Test plan How did you test the new or updated feature? --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
tx-tomcat
pushed a commit
to tx-tomcat/sui-network
that referenced
this pull request
Jul 29, 2024
## Description Adds a `checkpoint_timestamp_ms` to the watermark task and uses it in a new health check endpoint function. The health endpoint checks for two things - if there is a DB connection, otherwise it returns code 500 - if the last known checkpoint timestamp is within an acceptable buffer. It subtracts the current timestamp from the checkpoint timestamp, and checks if the value is larger than the provided query param `max_checkpoint_lag_ms` or a default value, and it returns code 504, GATEWAY TIMEOUT in that case. How to query this endpoint: `curl -X GET "http://127.0.0.1:8000/health" -i ` Set the check for max checkpoint time lag to 10s. If it returns 503, then the checkpoint is behind. `curl -X GET "http://127.0.0.1:8000/health?max_checkpoint_lag_ms=10000" -i` ## Test plan Added a new test. `cargo nextest run --features pg_integration -- test_health_check` --- ## 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: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds a
checkpoint_timestamp_ms
to the watermark task and uses it in a new health check endpoint function. The health endpoint checks for two thingsmax_checkpoint_lag_ms
or a default value, and it returns code 504, GATEWAY TIMEOUT in that case.How to query this endpoint:
curl -X GET "http://127.0.0.1:8000/health" -i
Set the check for max checkpoint time lag to 10s. If it returns 503, then the checkpoint is behind.
curl -X GET "http://127.0.0.1:8000/health?max_checkpoint_lag_ms=10000" -i
Test plan
Added a new test.
cargo nextest run --features pg_integration -- test_health_check
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.