Timed annotation not working properly for reactive methods / futures
See original GitHub issueDescribe the bug If you use the Timed annotation on a reactive method, it measures literally the time spent on the method, not the actual execution of the reactive action returned. Same happens with futures.
Expected behavior Either it works or it should be validated so people doesn’t get confusing results.
Actual behavior It calculates the time creating the Uni/Multi/Future, but not the actual execution of the task itself.
To Reproduce
Create a method returning a Uni and annotate it with Timed, when you check the metrics, it does not match the reality.
Configuration N/A
Screenshots N/A
Environment (please complete the following information):
- Output of
uname -a
orver
: - Output of
java -version
: - GraalVM version (if different from Java):
- Quarkus version or git rev: 1.10.x, 1.11.x, 1.12.x (probably all older ones)
- Build tool (ie. output of
mvnw --version
orgradlew --version
): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Additional context N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (17 by maintainers)
Top Results From Across the Web
Java + Micrometer @Timed annotation + Spring reactive ...
Just to avoid confusion, it is not working for the repository methods. I have @Timed in my @Controller layer, and different places of...
Read more >@Timed Annotation Using Metrics and AspectJ | Baeldung
We're using the @Metrics annotation at the class level to let the Metrics AspectJ framework know this class has methods to be monitored....
Read more >MicroProfile: @Metered vs. @Timed : Adam Bien's Weblog
The @Timed is useful to track the time spent in methods. Particularly the max attribute is useful to track possible performance problems.
Read more >Testing - Spring
This chapter covers Spring's support for integration testing and best practices for unit testing. The Spring team advocates test-driven ...
Read more >Micrometer Metrics - Quarkus
The @Timed annotation will wrap the execution of a method and will emit the following tags in addition to any tags defined on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/quarkusio/quarkus/pull/22639 should take care of it
Yup, just like
@Cached
works as well.If I have time, I’ll check it out.