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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAX-RS intergation doesn't work well with web servlet filter #67

Closed
tmszdmsk opened this issue Jan 31, 2018 · 7 comments
Closed

JAX-RS intergation doesn't work well with web servlet filter #67

tmszdmsk opened this issue Jan 31, 2018 · 7 comments

Comments

@tmszdmsk
Copy link
Contributor

Extracted from: #13 (comment)

Recently when I was working on Opentracing in Dropwizard project I noticed that jaxrs and servlet integrations do not play well together, i.e. jaxrs-integration spans are not children of servlet-integration created spans. Maybe original idea was that you should have only one of them installed but not all endpoints have to be handled by jaxrs so it is beneficial to have both.
My idea would be to modify jaxrs integration in such a way that:

  • if there is active span (presumably created by servlet integration), don't extract span information from request headers
  • if there is no active span - proceed as it is now.
@pavolloffay
Copy link
Collaborator

It makes sense, but why would you like to use filter integration with jax-rs. Could you please list some use cases?

@tmszdmsk
Copy link
Contributor Author

@pavolloffay
In the company I work, we want to provide common lib that will instrument our Dropwizard services. Not all endpoints are served by Jersey. We want to trace all.

Actually, in context of this issue, it doesn't have to be servlet filter. It should work the same with interceptors instrumenting e.g. specific web servers like Jetty.

@pavolloffay
Copy link
Collaborator

I see thanks, that totally makes sense.

Are you fine with having two spans per a request or do you want to disable the creation if there is an active span?

@tmszdmsk
Copy link
Contributor Author

tmszdmsk commented Feb 2, 2018

Sorry for the delay.

Two spans are actually good because JAX-RS can provide more information in tags e.g. resource method, resource path pattern we can later use to search through the collected data.

I pushed some proof of concept to #74.

@tmszdmsk
Copy link
Contributor Author

tmszdmsk commented Feb 6, 2018

PR merged, closing.

@tmszdmsk tmszdmsk closed this as completed Feb 6, 2018
@pavolloffay
Copy link
Collaborator

I have pushed 0.1.2.

@tmszdmsk thanks

@tmszdmsk
Copy link
Contributor Author

tmszdmsk commented Feb 6, 2018

👍

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

No branches or pull requests

2 participants