Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Measuring execution time using Micrometer and WebFlux

I'd like to measure the length of some async calls made with WebFlux. I've been reading through various sources, as I understand the @Timed annotation is working with AspectJ and basically just starts a timer before the method call and stops it after. This obviously won't work with async methods.

Are there any solutions for WebFlux or the only thing I can do is passing around execution timestamps, cluttering my application logic?

like image 514
OCPi Avatar asked May 11 '26 02:05

OCPi


1 Answers

Project Reactor natively supports Micrometer, please refer to the documentation to find out more: https://projectreactor.io/docs/core/milestone/reference/#_publisher_metrics

For example, you may want to monitor reactor.flow.duration.

like image 128
bsideup Avatar answered May 13 '26 05:05

bsideup