-
Notifications
You must be signed in to change notification settings - Fork 175
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
Health endpoint verifies Druid brokers' health and readiness #99
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6eb7d43
Added broker health checking, by means of loadstatus, for druid clusters
piter75 5b2eb07
Added health checking tests with nock
piter75 b98f405
Added health endpoint configuration
piter75 516b032
Added health checking documentation
piter75 cb4f25c
Skipping swiv route test
piter75 d02e7f0
Added health checking reference to healthCheckingTimeout property docs
piter75 ff1ed14
Fixes after review
piter75 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Checking health of Turnilo instance | ||
|
||
Turnilo instance's health is defined in terms of being able to communicate with all configured Druid brokers | ||
and those brokers knowing about all segments in Zookeeper. | ||
|
||
It can be checked by sending a GET request to a `healthEndpoint` path defined in Turnilo's server [configuration](configuration.md). | ||
|
||
Healthy Turnilo instance responds with HTTP status 200 while an unhealthy one responds with the status of 500. | ||
The body of a response contains health status of all configured brokers with optional error message on unhealthy brokers. | ||
|
||
While processing the health checking request Turnilo server will send its own requests to all configured | ||
druid clusters' brokers for `/druid/broker/v1/loadstatus` endpoint. It will check that all brokers responds within | ||
individually defined cluster timeout (`healthCheckingTimeout` property in [cluster properties](configuration.md#general-properties)) | ||
and that the response body contains `inventoryInitialized` flag set to `true`. | ||
If any of the requests to brokers fail to meet the criteria defined above the Turnilo instance is marked as unhealthy. | ||
|
||
# Response examples | ||
|
||
Healthy response example: | ||
``` | ||
HTTP/1.1 200 OK | ||
Content-Type: application/json; charset=utf-8 | ||
|
||
{ | ||
"clusters": [ | ||
{ | ||
"host": "localhost:8082", | ||
"message": "", | ||
"status": "healthy" | ||
} | ||
], | ||
"status": "healthy" | ||
} | ||
``` | ||
|
||
Unhealthy response example: | ||
``` | ||
HTTP/1.1 500 Internal Server Error | ||
Content-Type: application/json; charset=utf-8 | ||
|
||
{ | ||
"clusters": [ | ||
{ | ||
"host": "localhost:8082", | ||
"message": "inventory not initialized", | ||
"status": "unhealthy" | ||
}, | ||
{ | ||
"host": "192.168.99.100:8082", | ||
"message": "connection error: 'Error: ESOCKETTIMEDOUT'", | ||
"status": "unhealthy" | ||
} | ||
], | ||
"status": "unhealthy" | ||
} | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
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.
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.
I would return 503 as a more specific error.