It would be great if reactive HttpTraceWebFilter from spring-boot-actuator could support to trace only certain requests paths. Like localhost/my/sub/**, and not the whole application.

In MVC this was as easy as registering a FilterRegistrationBean. Probably this could be more a global feature for org.springframework.web.server.WebFilter than implementing a feature for a single WebFilter only.

Comment From: bclozel

The FilterRegistrationBean really depends on the FilterRegistration.Dynamic Servlet API and the concept of url pattern mappings as defined in the Servlet spec. This infrastructure in WebFlux is much lighter as it does not have concepts like dispatch types, mappings, contexts, etc. At this point, I think that subclassing HttpTraceWebFilter with a custom prefix-based matching algorithm would be easier and more to the point.

Comment From: wilkinsona

subclassing HttpTraceWebFilter with a custom prefix-based matching algorithm would be easier and more to the point

I think that's the best option here too. I don't think we should add specific matching support to HttpTraceWebFilter. If it's to be done at all (and I doubt that it should be), that feels like something for WebFilter to me too.

Comment From: bclozel

Alright I'm going to decline this one, subclassing seems to be the best option right now. We might reconsider if there is evidence that Spring Framework should support something like this. I don't think this is the case now.