We recently switched an application from WebMvc to WebFlux. We used the @Timed
annotation on our controller methods to get custom timing metrics with custom percentiles. After switching to WebFlux, this stopped working. There is the default metric created by the MetricsWebFilter
, but I couldn't find a way to configure the percentiles recorded.
It would be great if you could also support the @Timed
annotation for WebFlux for maximum flexibility.
Alternatively, it would also help us if we could globally configure the percentiles for the timer recorded by the MetricsWebFilter
.
Comment From: Vakhturov
Hi team, could anyone please clarify the status of this issue? The linked PR looks good and nothing seems be prevent this from merging, but there is no update since August.
Comment From: wilkinsona
@Vakhturov Unfortunately, we haven't had time to review the pull request yet. We'd like to get the changes into a 2.x release but it's unlikely to be in 2.4.x which RCs tomorrow.
Comment From: patpatpat123
Hello Team,
I am currently using 2.4.1 recently released. The issue is still here I believe.
Created an out of the box Webflux project out of spring.io. No @Timed annotation, can see the usual
# TYPE http_server_requests_seconds summary
http_server_requests_seconds_count{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/myRoute",} 1.0
http_server_requests_seconds_sum{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/myRoute",} 0.610389546
# HELP http_server_requests_seconds_max
# TYPE http_server_requests_seconds_max gauge
http_server_requests_seconds_max{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/myRoute",} 0.610389546
However, annotated my controller with @Timed("pleasefindme") and getting the exact same under /prometheus endpoint.
A little help please? Thank you
Comment From: snicoll
The issue is still here I believe.
@patpatpat123 this issue is open and assigned to 2.x
(i.e. unresolved). The feature is not implemented so this to be expected.
Comment From: izeye
This seems to be resolved via https://github.com/spring-projects/spring-boot/pull/23112.
Comment From: wilkinsona
Yes indeed. Thanks, @izeye.
Comment From: patpatpat123
Many thanks all