question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timed annotation not working properly for reactive methods / futures

See original GitHub issue

Describe 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 or ver:
  • 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 or gradlew --version): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Additional context N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
geoandcommented, Jan 5, 2022
1reaction
geoandcommented, Jan 4, 2022

Yup, just like @Cached works as well.

If I have time, I’ll check it out.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found