- Notifications
You must be signed in to change notification settings - Fork237
Add AggregatedMetrics to support multiple Metrics implementations#2917
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Add AggregatedMetrics to support multiple Metrics implementations#2917
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
f36afa7 to2528836Compare This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
2528836 toe80267dCompareThere 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.
Pull Request Overview
This PR introduces anAggregatedMetrics class that implements the composite pattern to aggregate multipleMetrics implementations, allowing simultaneous collection of metrics data by different monitoring systems.
Key changes:
- New
AggregatedMetricsclass that delegates calls to multiple metrics instances - Special handling for
timeControllerExecution()which only delegates to the first metrics instance - Comprehensive test suite with 100% coverage of the new functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| AggregatedMetrics.java | Core implementation of the composite metrics aggregator with delegation logic |
| AggregatedMetricsTest.java | Complete test suite covering constructor validation, method delegation, and special cases |
| pom.xml | Added mockito-core test dependency for unit testing |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
...pport/src/main/java/io/javaoperatorsdk/operator/monitoring/micrometer/AggregatedMetrics.javaShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...t/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/AggregatedMetricsTest.javaShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Donnerbart commentedAug 27, 2025
The new class should probably go into the same package as the |
| * All method calls are delegated to each metrics instance in the list in the order they were | ||
| * provided to the constructor. | ||
| * | ||
| * <p><strong>Important:</strong> The {@link #timeControllerExecution(ControllerExecution)} method |
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.
Good point. I forgot about that when I suggested this design! 😓
xstefank left a comment
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.
LGTM
csviri commentedAug 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi@Donnerbart loogks, great, would be better if you could target |
e80267d to255ef8aCompare425634c to3e80997Compare…tionsSigned-off-by: David Sondermann <david.sondermann@hivemq.com>
3e80997 toac8e46eCompareSigned-off-by: David Sondermann <david.sondermann@hivemq.com>
Donnerbart commentedAug 28, 2025
|
a86fc2c intooperator-framework:nextUh oh!
There was an error while loading.Please reload this page.
Partiallyfixes#2884
Alternative to#2912
See#2912 (comment)