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

BraveScopeManager.active() and opentracing-jaxrs #82

Closed
jmif opened this issue May 23, 2018 · 10 comments
Closed

BraveScopeManager.active() and opentracing-jaxrs #82

jmif opened this issue May 23, 2018 · 10 comments

Comments

@jmif
Copy link

jmif commented May 23, 2018

Hi there,

We're having some issues with closing Scopes / Spans with opentracing-jaxrs. This is related to opentracing-contrib/java-jaxrs#87 and I'm hoping to get your input on the issue with respect to BrowserScopeManager / BrowserScopeManager.active()

At a high level (more details in referenced issue) the JAXRS filter tries to close the current scope at the end of the request and it grabs the current scope from the BraveTracer's BraveScopeManager here.

It then attempts to close the scope however the Scope returned from the BraveScopeManager has a noop close method. This results in the scope not being closed and being used across requests.

Is this the expected behavior of active() (seems to be given the comment on the method)? If so what is the best way to get the active scope and close it in this context?

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented May 24, 2018 via email

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented May 24, 2018 via email

@pavolloffay
Copy link
Contributor

Agree that it's safer to pass the span around in attribute. Actually the scope in this case.

Is there any reason why BraveScopeManager.active().close() is noop? I don't think it complies with OpenTracing API. It will cause problems in other use-cases.

@pavolloffay
Copy link
Contributor

This is also related to opentracing/opentracing-java#267 and

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented May 30, 2018 via email

@codefromthecrypt
Copy link
Contributor

while still thrashing there seems to be some hope that the api will be corrected opentracing/opentracing-java#267 (comment)

@rogueai
Copy link

rogueai commented Nov 16, 2018

Hi guys, I'd like to add to this issue both to try to understand an issue I'm facing, and to figure out a proper fix for that.
I'm using spring messaging in my project, and it seems their OpenTracingChannelIntercpetor tries to close the scope after the message is sent, see OpenTracingChannelInterceptor code here
So it looks like this is allowed by the OpenTracing spec, now the fact that in brave opentracing this is a No-op, that leaves my spans open across messages and I never get any tracing for them.
I tried to put a fix for that by caching the scopes in the interceptor when the spans start, but it does look like a hack to me, plus I'm worried about messing up the scopes.

Do you have suggestions on that? Can I achieve the same result without overriding their interceptor, or perhaps there's a better way to handle that?

Thanks.

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Nov 16, 2018 via email

@codefromthecrypt
Copy link
Contributor

sadly it looks like 0.32 still exposes (hence implies tracking of) the current scope instance opentracing/opentracing-java#267

@codefromthecrypt
Copy link
Contributor

opentracing 0.33 removes this method

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

4 participants