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

gRPC server instrumentation creates multiple traces on streaming requests #257

Closed
alertedsnake opened this issue Dec 15, 2020 · 0 comments · Fixed by #260
Closed

gRPC server instrumentation creates multiple traces on streaming requests #257

alertedsnake opened this issue Dec 15, 2020 · 0 comments · Fixed by #260
Labels
bug Something isn't working

Comments

@alertedsnake
Copy link
Contributor

Environment
Current master code, basically the sample code in the documentation, testing with a unary request vs. a streaming request.

Steps to reproduce
Create a simple gRPC servicer with two RPCs, one which returns a single message (the unary response), and one which yields items in a list for a streaming response.

The key here is to make an instrumented request within the primary request handler (I'm using a simple HTTP get with the Requests instrumentation), so you get an additional span which should be attached to the same trace.

What is the expected behavior?
A single trace with the main span, and a second child span for the HTTP request.

What is the actual behavior?
Two separate traces, each containing a single span.

Additional context
The problem only occurs on streaming requests - I'm sure the reworking I did as part of open-telemetry/opentelemetry-python#1171 is where the problem started, I didn't take into account the streaming case specifically with multiple spans, and naturally, there are no tests for anything streaming, only unary responses.

So as part of this, we'll need some useful tests as well. I'll see if I can write up my test case as an actual test case.

And again, I've got a vested interest in this working, so I'll have a PR up soon.

@alertedsnake alertedsnake added the bug Something isn't working label Dec 15, 2020
alertedsnake pushed a commit to alertedsnake/opentelemetry-python-contrib that referenced this issue Dec 15, 2020
@alertedsnake alertedsnake mentioned this issue Dec 16, 2020
5 tasks
alertedsnake pushed a commit to alertedsnake/opentelemetry-python-contrib that referenced this issue Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant