Added class and method tags to Timed/Counted interceptors. #749
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.
Hi!
I'm using a micrometer heavily, and currently, whenever I need to measure some method usage (timer/counter) I always need to do something like this:
But it's very verbose and requires manually adding class names and method name tags for each method. I think it will be better if
TimedInterceptor
/CountedInterceptor
will be able to add this information when it requires. My current implementation is adding these tags for all timers/counters, which I'm not sure is a good solution for everybody, maybe it's better to add an ability to control this behavior inside the annotation, something like this:And usage will be:
I like this approach more, but it requires to copy
Timed
/Counted
annotations from the micrometer repository and keeping them here in the micronaut repository as alternatives with this extension.