-
Notifications
You must be signed in to change notification settings - Fork 821
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
Can not execute the operation on ended Span opentelemetry-instrumentation-http #2575
Comments
Looking at all the events in https://nodejs.org/api/http.html#httprequesturl-options-callback I think |
I did rewrite the old plugin to the new instrumentation system but i didn't write the original code which i'm pretty sure was ported from opencensus. EDIT: @bogdandrutu Do you want/have the time to make a PR to fix this ? PS: thanks for the detailed bug report, really appreciated |
Hi guys, is there any news ? |
@vmarchaud pinged the wrong bogdan. I think he meant to ask if you @bogdanoliinyk want to make a PR |
Yep, github username suggestions sometimes betray me :) |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
I'm hitting this (I think), but I'm unable to consistently reproduce. In our case it happens with the https instrumentation when fetching data from GCS.
|
By adding some logging, I can see it's the same |
nevermind i'm just confusing myself in the maze of docs |
What version of OpenTelemetry are you using?
0.18.0
What version of Node are you using?
tested 12 and 14
Please provide the code you used to setup the OpenTelemetry SDK
What did you do?
http request call
What did you expect to see?
Span created and closed with all data set
What did you see instead?
Can not execute the operation on ended Span
Additional context
That happens because request
close
event fired before the responseend
event.socketCloseListener
might emitsclose
event before readable steam ended.Due to it, http instrumentation going to close Span
opentelemetry-js/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
Line 344 in 357ec92
Response
end
event will set Span status, that will lead to ended span issue.opentelemetry-js/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
Line 317 in 357ec92
It might be tricky to reproduce, as I see it relay on response content size. In most cases, request
close
event is fired after responseend
. I was lucky to reproduce it.There is some logic in a stream implementation.
Possible solution
Request
end
event might be changed with aclose
event.opentelemetry-js/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
Line 307 in 357ec92
Response
close
event will be fired after requestclose
bysocketCloseListener
implementation.Lines: 389 and 393
Related items
#2126
The text was updated successfully, but these errors were encountered: