-
Notifications
You must be signed in to change notification settings - Fork 118
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
Introduce client-side micrometer, start with exposing watcher revision metrics #542
base: main
Are you sure you want to change the base?
Conversation
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.
Oops... I missed this PR. Mostly LGTM. 🙇♂️
@@ -201,4 +205,9 @@ protected final ScheduledExecutorService executor() { | |||
return CompletableFuture.completedFuture(revision); | |||
} | |||
} | |||
|
|||
@Override | |||
public MeterRegistry meterRegistry() { |
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.
Add final
?
|
||
/** | ||
* Creates a new instance. | ||
* | ||
* @param executor the {@link ScheduledExecutorService} which will be used for scheduling the tasks | ||
* related with automatic retries. | ||
*/ | ||
protected AbstractCentralDogma(ScheduledExecutorService executor) { | ||
protected AbstractCentralDogma(ScheduledExecutorService executor, MeterRegistry meterRegistry) { |
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.
This could cause breaking changes.
Could you add a new one?
client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogma.java
Outdated
Show resolved
Hide resolved
This looks good! |
1c3ad2b
to
a9cfd8e
Compare
Codecov Report
@@ Coverage Diff @@
## master #542 +/- ##
============================================
+ Coverage 70.22% 70.28% +0.05%
- Complexity 3354 3361 +7
============================================
Files 336 336
Lines 13359 13388 +29
Branches 1443 1447 +4
============================================
+ Hits 9382 9410 +28
- Misses 3084 3085 +1
Partials 893 893
Continue to review full report at Codecov.
|
f04c394
to
e32a68e
Compare
How about implementing it in this PR?
Shouldn't we warn in this case? |
268209c
to
fa61474
Compare
I tried this out, but this means for the user either:
I'm thinking whether simply removing the option to set Let me know what you think Update 2021/6/4 I realized I guess this boils down to
|
fa61474
to
075c264
Compare
rebased once - gentle ping, as I still think this PR has value |
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.
Sorry for the late review. Mostly looking good to me!
client/java/src/main/java/com/linecorp/centraldogma/client/AbstractCentralDogmaBuilder.java
Outdated
Show resolved
Hide resolved
client/java/src/main/java/com/linecorp/centraldogma/internal/client/AbstractWatcher.java
Outdated
Show resolved
Hide resolved
+1 for always using |
Ready for the next round of reviews 🙏 |
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.
Thanks! left some questions. 😄
client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogma.java
Outdated
Show resolved
Hide resolved
client/java/src/main/java/com/linecorp/centraldogma/internal/client/AbstractWatcher.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
CompletableFutures.allAsList(futures).thenAccept(results -> { | ||
final boolean result = results.stream().allMatch(x -> x); |
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.
Shouldn't we update the latestNotifiedRevision
regardless of a listener throws an exception?
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've added another metric which updates the revision irregardless of whether the notify succeeds.
I think the two metrics combined can give users a good idea of whether properties have been propagated correctly.
What's the status of this PR since then? 😅 |
Related to #516
Motivation
We often add logs to check if each watcher has called its notifiers successfully.
Using meters should improve this since:
Rather than migrating our 50+ watchers, I would like to propose centraldogma provides this functionality out of the box.
Modifications
*CentralDogmaBuilder
to specifyMeterRegistry
MeterRegistry
to constructors for*CentralDogma
Gauge
for watcher revisionsKnown Limitations
*CentralDogma.meterRegistry
andClientFactory.meterRegistry
might be different, which might cause confusion.*CentralDogma
can useClientFactory.meterRegistry
by default if not specified. I think this can also be supported without any breaking changes in the future though.