You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Filtering out class proxies from stacktraces (in Java) #6283
Hi,
I'm relatively new to Java, so I'm not sure how this really works, but Spring is using something (CGLIB?) to generate proxies and they're not really that interesting when it comes to stacktraces.
It would be nice, if Sentry could automatically recognize that the line in stacktrace is from a proxy and mark it as "library code".
For clarification: the nondeterministic bits are stripped out for consideration in the grouping hash generation algorithm, but we still display it as part of the stacktrace in the UI.
I think it's usefull info in the stack - you want to know it was called from a proxy, but it should not be marked as part of my app, since it's generated.
Hey @fprochazka, this sounds like a safe/fine change to me. It should probably happen on the SDK (sentry-java) side. We could have a list of special cases we check for and exclude from the app frames. In this case I assume frames containing $$FastClassBySpringCGLIB$$ would be safe to exclude.
Do you mind opening an issue at sentry-java? I can try to get to this later this week.
@bretthoerner you want to not send them to sentry server at all, or just mark them somehow? I'm not sure what "exclude from the app frames" means - if it means just to not mark them as part of my application, then yay! :)
Activity
mattrobenolt commentedon Oct 9, 2017
So we should be doing that already: https://github.com/getsentry/sentry/blob/master/src/sentry/interfaces/stacktrace.py#L38-L42
Well, not exactly that, but we should be stripping that bit out.
When testing this manually, it seems to do the right thing.
Are you running a really old Sentry or something?
tkaemming commentedon Oct 9, 2017
For clarification: the nondeterministic bits are stripped out for consideration in the grouping hash generation algorithm, but we still display it as part of the stacktrace in the UI.
mattrobenolt commentedon Oct 9, 2017
Ohhh, TIL. I thought we removed it entirely from the stack itself.
fprochazka commentedon Oct 9, 2017
Actually I've installed it few days ago based on the current
onpremiserepository in a docker container :)fprochazka commentedon Oct 9, 2017
I think it's usefull info in the stack - you want to know it was called from a proxy, but it should not be marked as part of my app, since it's generated.
bretthoerner commentedon Oct 10, 2017
Hey @fprochazka, this sounds like a safe/fine change to me. It should probably happen on the SDK (
sentry-java) side. We could have a list of special cases we check for and exclude from the app frames. In this case I assume frames containing$$FastClassBySpringCGLIB$$would be safe to exclude.Do you mind opening an issue at
sentry-java? I can try to get to this later this week.fprochazka commentedon Oct 10, 2017
@bretthoerner you want to not send them to sentry server at all, or just mark them somehow? I'm not sure what "exclude from the app frames" means - if it means just to not mark them as part of my application, then yay! :)
bretthoerner commentedon Oct 10, 2017
Ya, I assume you're using the stacktrace.app.packages config option?
So in the SDK we won't mark frames as "in app" if they match the blacklist of regexes.
fprochazka commentedon Oct 10, 2017
@bretthoerner awesome 👍
bretthoerner commentedon Oct 10, 2017
Cool, closing in factor of that issue.
michaelgantman commentedon May 29, 2018
I delt with the same problem and wrote a utility that smartly filters out stacktrace based on user configuration. It works very well. I published this utility as part of my MgntUtils Open Source Java library. It is available on Github (https://github.com/michaelgantman/Mgnt) and Maven Central (https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.michaelgantman%22%20AND%20a%3A%22MgntUtils%22). Here is the link to the article that explains what utilities are available in the library and how to use them: https://www.linkedin.com/pulse/open-source-java-library-some-useful-utilities-michael-gantman/