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

Check for null extracted context before creating a child span #61

Open
kcirone opened this issue Oct 26, 2019 · 0 comments
Open

Check for null extracted context before creating a child span #61

kcirone opened this issue Oct 26, 2019 · 0 comments

Comments

@kcirone
Copy link

kcirone commented Oct 26, 2019

There are some implementations (I've observed) of OpenTracing that do not accept null arguments to SpanBuilder.asChildOf(). If tracer.extract() returns null (ie. no span context was passed to the servlet) and it is used to create a child span, .asChildOf() will cause a NullPointerException.

The equivalent operation would be to avoid calling .asChildOf() if extractedContext is null, which should work for any implementation.

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

1 participant