Enhance WebRequestTraceFilter to allow excluding capture of certain request paths(eg /management)
See original GitHub issueThe WebRequestTraceFilter
captures and stores all requests currently.
Sometimes, I just want to trace the request mapped in my own Controller, and exclude others that I don’t care about. Based on this feature, it’s easier to integrate more useful features. For a simple example, only captures real user’s request, assigns or get a request-id, then calculates response time, and store the trace result.
I currently defined a TraceRepository
bean, rewrite the TraceRepository.add
method to exclude certain request paths. But I think it’s better to enhance WebRequestTraceFilter
. I would propose adding a collection named ‘excludedPaths’ to TraceProperties
, and checking against in WebRequestTraceFilter.doFilterInternal()
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Spring Boot Actuator Trace: Logging HTTP requests
Enabling the Spring Boot Actuator Trace endpoint. The trace endpoint is at http://localhost:8080/trace. Unfortunately, if you try this without ...
Read more >Spring Boot - How to log all requests and responses with ...
Hosting providers, Heroku for example, provide request logging as part of their service and you don't need to do any coding whatsoever then....
Read more >Excluding URLs for a Filter in a Spring Web Application
In this tutorial, we'll learn how a filter-style task can be included or excluded from execution for a given set of URLs. 2....
Read more >Spring Cloud Gateway
GatewayFilter Factories. Route filters allow the modification of the incoming HTTP request or outgoing HTTP response in some manner. Route filters are scoped...
Read more >Help, my Spring Boot info actuator endpoint is enabled, but I ...
Did you recently upgrade your Spring Boot application to version 2.6.x? ... the management.endpoints.web.exposure.include property to enable ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks to the changes made for #6309 you can declare your own custom
WebRequestTraceFilter
bean in 1.4. You can subclassWebRequestTraceFilter
and overrideshouldNotFilter
to exclude certain paths.great, thanks.