Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument java.servlet.Filter directly #1606

Merged
merged 3 commits into from
Nov 19, 2020

Conversation

trask
Copy link
Member

@trask trask commented Nov 9, 2020

I'm not sure why we instrument java.servlet.FilterChain.doFilter() instead of the more general java.servlet.Filter.doFilter().

Let's see if any tests fail with this change 馃槀.

See #1578

@iNikem
Copy link
Contributor

iNikem commented Nov 17, 2020

@trask what are your plans for making this real PR?

Comment on lines -25 to +28
public class HandlerMappingResourceNameFilter extends OncePerRequestFilter implements Ordered {
public class HandlerMappingResourceNameFilter implements Filter, Ordered {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't have helper class extend OncePerRequestFilter, because then OncePerRequestFilter won't be instrumented itself

@trask trask marked this pull request as ready for review November 18, 2020 07:58
@mateuszrzeszutek
Copy link
Member

How does it compare to FilterInstrumentationModule in servlet-common? Can we get rid of that one?

@trask
Copy link
Member Author

trask commented Nov 19, 2020

FilterInstrumentationModule captures a span for every filter in the chain. I'd be happy to remove it, not sure why someone would want that. I'll submit a PR for that and see if anyone objects 馃槃.

@trask trask merged commit 80b068b into open-telemetry:master Nov 19, 2020
@trask trask deleted the instrument-filter-directly branch November 19, 2020 03:59
@iNikem iNikem mentioned this pull request Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants