3

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?

OCPi
  • 316
  • 1
  • 5
  • 16

1 Answers1

6

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.

bsideup
  • 2,845
  • 17
  • 21