-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add conditional on TraceWebFilterAutoConfiguration #8322
Comments
It looks like it duplicates #2921 somehow |
It's a little clunky, but you can disable the filter by creating a @Bean
public FilterRegistrationBean webRequestTraceFilterRegistration(
WebRequestTraceFilter filter) {
FilterRegistrationBean registration = new FilterRegistrationBean(filter);
registration.setEnabled(false);
return registration;
} |
Right @wilkinsona -> but as there is already property which enables |
I'm not sure I agree with that. You may want to use the repository, which is populated by the filter, without having the endpoint enabled. |
It looks like an extremely rare use case. But even then you can just register the filter manually. Enabling it always when it has big overhead is bad idea. |
We don't have any usage data at that level so I have no idea.
Given that you are the first person to raise this, I doubt that it has a big overhead for most users of the Actuator.
How do you know that? |
Actually, I think we need to wind this one right back to the start.
Can you please quantity "big"? Without some data, it's impossible to know if there's a need to do anything at all here. With some data, we might be able to optimise |
@wilkinsona check this issue - spring-cloud/spring-cloud-sleuth#522 |
@marcingrzejszczak I already have. I only see two lines of data there that directly relate to the filter in question here and I'm not sure how to interpret them |
AFAIR from the analysis it turned out that that trace actuator filter is caching a lot of objects related to request / response header retrieval. Due to this a lot of objects were created and the result was leading to a much longer garbage collection time. |
Sorry, that still doesn't really quantify things. What, exactly, were the requests involved and what does "much longer" mean? I can see some object creation that could be avoided but I still haven't seen anything that tells us it's worth worrying about. |
As for what the app does - it's a really simple application - https://github.com/marcingrzejszczak/sleuth-memory-benchmarks/blob/master/sleuth-application/src/main/java/com/example/SleuthApplication.java . In the tests we were sending a request to the AFAIR the stats are concerned - they're written in the other issue - let me copy it here. Without the Actuator dependency we don't have the Web Trace Filter and the GC time is stable as you can see (increase of GC time is 17-20% regardless of the number of requests) WITHOUT actuatorThese are the results for application WITHOUT the actuator dependency:
WITH actuatorThese are the results for application WITH the actuator dependency. When we do have the Web Trace Filter in action then the GC time is getting larger with the increased number of requests.
|
Thanks but, as I said above, I've already read that data and none of it is specifically about the web request trace filter. Can you share the data that let you make the link between the increase in GC time and the web request trace filter? Right now, for all I know, there could be other parts of Actuator that are to blame and this issue is very specifically about one particular filter. It's also interesting that if I compare the with and without Actuator numbers without Sleuth, the GC time is pretty much constant (it evens drops substantially in the 2000 requests case). Were the two sets of numbers gathered in such a way that it's fair to compare them? If so, it would suggest that a combination of something in Actuator and something in Sleuth causes an increase in GC time. I think that warrants further investigation and is at odds with blanket statements like "enabling it always when it has big overhead is bad idea." |
I see. Sure, I'll run some more tests and provide more precise data. I've executed the tests on the same machine that was doing nothing else than that so the conditions were comparable. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
…stTraceFilter) following the pattern in MetricFilterAutoConfiguration spring-projects#8322
…stTraceFilter) following the pattern in MetricFilterAutoConfiguration spring-projects#8322
…stTraceFilter) following the pattern in MetricFilterAutoConfiguration spring-projects#8322
The
WebRequestTraceFilter
introduces big gc/memory footprint mostly due to Map operations. It's enabled by default as there is no condition onTraceWebFilterAutoConfiguration
. It'd be great to be able to disable it in a simple way as it's rarely being used.The text was updated successfully, but these errors were encountered: