-
Notifications
You must be signed in to change notification settings - Fork 66
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
Build more tags using method context #753
Build more tags using method context #753
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.
This is a breaking change. You would need to add a new constructor (the new one should be annotated with @Inject
while keeping and deprecating the old one (protected TimedInterceptor(MeterRegistry meterRegistry, ConversionService conversionService)
) removing the @Inject
annotation from it
.../src/main/java/io/micronaut/configuration/metrics/micrometer/intercept/TimedInterceptor.java
Show resolved
Hide resolved
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.
You need to add also documentation for this feature.
...n/java/io/micronaut/configuration/metrics/aggregator/TagsBasedOnMethodInvocationContext.java
Outdated
Show resolved
Hide resolved
...n/java/io/micronaut/configuration/metrics/aggregator/TagsBasedOnMethodInvocationContext.java
Outdated
Show resolved
Hide resolved
...n/java/io/micronaut/configuration/metrics/aggregator/TagsBasedOnMethodInvocationContext.java
Outdated
Show resolved
Hide resolved
...n/java/io/micronaut/configuration/metrics/aggregator/TagsBasedOnMethodInvocationContext.java
Outdated
Show resolved
Hide resolved
...n/java/io/micronaut/configuration/metrics/aggregator/TagsBasedOnMethodInvocationContext.java
Outdated
Show resolved
Hide resolved
...n/java/io/micronaut/configuration/metrics/aggregator/TagsBasedOnMethodInvocationContext.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/micronaut/configuration/metrics/micrometer/intercept/TimedInterceptor.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/micronaut/configuration/metrics/micrometer/intercept/TimedInterceptor.java
Show resolved
Hide resolved
.../src/main/java/io/micronaut/configuration/metrics/micrometer/intercept/TimedInterceptor.java
Outdated
Show resolved
Hide resolved
Just now realizing this is probably also helpful / can support |
bringing attention to @graemerocher 's comment here, this seems like something that could be done here as well? Perhaps not all The only thing I am unsure of is if you wanted your tagger to have some other bean injected how that would work. I feel there is a way to do it, I am just not familiar enough with that |
you can inject it into the constructor of the tagger, for example if you need the |
Even if doing something like |
would be a matter of adding a filter to the stream based on the types that are resolved from the annotation |
that makes sense, would that then mean we need to create our own annotations to replace |
yeah I guess we would have our own version kind of like how we have both Jakarta |
another thought that came to mind: could you create a new annotation that is just used alongside the existing ones? Wouldn't introduce a breaking change, but maybe something like: @Timed(value = "requests")
@AddTags(taggers = [MyTagger.class])
fun timedRequest() = println("time me") Doesn't require updating the |
I would probably call it |
is this something that would be wanted for/in this PR or just something that could come later down the line? |
No can be done in a subsequent PR |
Am I expected to merge this PR? I don't seem to have the right authorization to do so with approvals present, and not sure if @sdelamo change requests need to be cleared prior |
Aiming to solve #752 and potentially also make #612 possible
Any beans implementing
TagsBasedOnMethodInvocationContext
are injected and additional tags are computed usingbuildTags(MethodInvocationContext context)