-
Notifications
You must be signed in to change notification settings - Fork 1k
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
add copy() method to Builders #4104
Conversation
Also suggest to make small breaking change and convert public |
Let me collect similar/involved issues/PRs here:
I think we should gather the use cases for this and what we can provide for this today, what changes might needed. |
Some thoughts:
I prefer to split this problem into 2 parts:
Right now, I know 2 use cases related to tags (dynamic tags and gauge with different objects/functions per dynamic tag) |
If you would like us to look at this PR, please provide the requested information. If the information is not provided within the next 7 days this PR will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this, please provide the requested information and we will re-open. |
Summary
This PR allows to reuse builders as templates for dynamic tags, factories, etc.
Changes
Introduce additional copy() method in all specific Meter's Builders, Tags and DistributionStatisticConfig.
Why is this important?
Currently, Micrometer doesn't provide a straightforward way to reuse builders. This PR eliminates the need to fully describe all fields for each similar builder, thereby simplifying metric management.
Backwards Compatibility
This feature is partially backward-compatible:
(fix bug DistributionStatisticConfig object is mutable #3489)
Test Coverage
CopyableTest class has simple test that verify new functionality, will extend it to cover all cases if you agree with design.
Usage Example
After this change, you can use new copy() method to create metric with dynamic tags