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

Health endpoint verifies Druid brokers' health and readiness #99

Merged
merged 7 commits into from
Apr 20, 2018

Conversation

piter75
Copy link
Contributor

@piter75 piter75 commented Apr 19, 2018

Fixes #82

Copy link
Member

@mkuthan mkuthan left a comment

Choose a reason for hiding this comment

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

Minor findings but looks good at overall.


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.
Copy link
Member

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.

@@ -82,6 +84,7 @@ function ensureNotTiny(v: number): void {
export class Cluster extends BaseImmutable<ClusterValue, ClusterJS> {
static TYPE_VALUES: SupportedType[] = ['druid', 'mysql', 'postgres'];
static DEFAULT_TIMEOUT = 40000;
static DEFAULT_HEALTH_CHECKING_TIMEOUT = 1000;
Copy link
Member

Choose a reason for hiding this comment

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

There is no continuous form in other configuration properties. So I would use default_health_check_timeout.

const unhealthyHttpStatus = 500;
const healthyHttpStatus = 200;

type ClusterHealthStatus = typeof healthyStatus | typeof unhealthyStatus;
Copy link
Member

Choose a reason for hiding this comment

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

Consider enum

@piter75 piter75 merged commit d72986c into master Apr 20, 2018
@piter75 piter75 deleted the proper_health_checking branch April 20, 2018 08:27
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