Add Metrics for External Custom Health Check Requests#1383
Merged
huizhilu merged 3 commits intoapache:masterfrom Sep 30, 2020
Merged
Add Metrics for External Custom Health Check Requests#1383huizhilu merged 3 commits intoapache:masterfrom
huizhilu merged 3 commits intoapache:masterfrom
Conversation
46d54e3 to
5a07b17
Compare
5a07b17 to
d940466
Compare
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Show resolved
Hide resolved
jiajunwang
reviewed
Sep 25, 2020
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/HelixRestServer.java
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Show resolved
Hide resolved
13c1079 to
f497030
Compare
huizhilu
commented
Sep 29, 2020
Contributor
Author
huizhilu
left a comment
There was a problem hiding this comment.
Thanks @zhangmeng916 @jiajunwang for the review! I've updated the PR to pass the tests and adjust the code.
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/common/HelixDataAccessorWrapper.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
f497030 to
858a947
Compare
jiajunwang
reviewed
Sep 29, 2020
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
Show resolved
Hide resolved
77906d5 to
575c0dd
Compare
575c0dd to
591b2ad
Compare
kaisun2000
approved these changes
Sep 30, 2020
Contributor
kaisun2000
left a comment
There was a problem hiding this comment.
The diff generally looks ok to me. Approve for now.
There are some comments JJ, please sync with him.
Contributor
Author
|
Thanks, all, for the review! This PR is ready to be merged, approved by @kaisun2000 @alirezazamani |
This file contains hidden or 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
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.
Issues
Resolves #1382
Description
Custom rest client interacts with participant side to query for its health checks. Currently there is no metrics for the query requests. We'd like to have metrics for the requests.
Here's a design trade-off:
getInstanceStoppableCheck(baseUrl, customPayloads, namespace)in interfaceCustomRestClient. We need the namespace name when recording metrics inCustomRestClient. Since CustomRestClient is a singleton instance, we can not inject the namespace to the class. Having the namespace as a parameter in the API is an option. The benefit is we can accurately record the http request latency, and it is more scalable if we have more places calling the API, we don't need to do anything. Cons: change existing interface to add the new API. Though it is an interface, we may not expect external users to use it. So it should be fine to change the interface.CustomRestClient, eg.InstanceServicewheregetInstanceStoppableCheck()is called, we record the metrics. Pros: we don't need to change existing interfaceCustomRestClient. Cons: Latency of http request is more than the actual number because other stuff like json response parsing is also involved inCustomRestClient; and it is not scalable because we have to record metrics in each place whereCustomRestClient. getInstanceStoppableCheck()is called.This PR implements option 2), because there are not many places that call
CustomRestClientAPIs, and it doesn't look good that pass the namespace as a parameter just for metrics rather than logic related.Tests
(List the names of added unit/integration tests)
Documentation (Optional)
(Link the GitHub wiki you added)
Commits
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)