micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Allow injecting a function into TimedAspect to create tags based on method result

Open kevinkraus opened this issue 2 years ago • 11 comments

Please describe the feature request. Update TimedAspect to allow injecting a Function to create tags based on method result, similar to the Function injected to create tags based on ProceedingJoinPoint.

Rationale I am using the Timed annotation and would like to include information from the Object returned by the target method in the tags.

Additional context I'm willing to submit a PR for this enhancement.

kevinkraus avatar Mar 07 '22 17:03 kevinkraus

Hi, any news on this? I think that would be really interesting, not just for TimedAspect but for CountedAspect as well. I'm also willing to participate in the implementation.

axel-malagraba-sw avatar Sep 13 '22 09:09 axel-malagraba-sw

We already have it since 1.7.0? https://github.com/micrometer-metrics/micrometer/blob/v1.12.1/micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java#L156 Or am I missing sth?

marcingrzejszczak avatar Dec 20 '23 15:12 marcingrzejszczak

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

github-actions[bot] avatar Jan 02 '24 10:01 github-actions[bot]

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open.

github-actions[bot] avatar Jan 10 '24 01:01 github-actions[bot]

This seems to suggest adding a function that provides tags from the return value of ProceedingJoinPoint.proceed() while Micrometer currently supports a function that provides tags from ProceedingJoinPoint.

izeye avatar Jan 19 '24 13:01 izeye