-
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
feat(instrumentation-http): add diag debug on http request events #2126
Conversation
@@ -338,17 +338,20 @@ export class HttpInstrumentation extends InstrumentationBase<Http> { | |||
this._closeHttpSpan(span); | |||
}); | |||
response.on('error', (error: Err) => { | |||
diag.debug('outgoingRequest on error()'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be outgoingRequest on response error()
but then we probably need to change this line https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-instrumentation-http/src/http.ts#L314
Codecov Report
@@ Coverage Diff @@
## main #2126 +/- ##
==========================================
+ Coverage 92.85% 93.64% +0.78%
==========================================
Files 120 55 -65
Lines 4031 1762 -2269
Branches 853 363 -490
==========================================
- Hits 3743 1650 -2093
+ Misses 288 112 -176
|
Not really sure this is the correct way to tackle the problem, its make more sense to me to trace the |
@vmarchaud indeed, but this log does not provide any stack trace and even if I could fetch the stack trace at that point it probably too late (the span is already ended, the log is just a side effect for the real problem) BTW - we found how to solve it, but yet not the root cause of this issue - the warnings disappeared after we set |
I was suggesting to add the stackrace for this log (https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-tracing/src/Span.ts#L229) instead, with this you should be know which functions triggered the second |
this would be great, but yet I don't think that adding a stacktrace would point me to the issue, the issue is the first call of span. end and not the second call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a friendly ping on this, to prevent it from being stalled
imho I don't see a problem adding more debug information, just suggested to add yet the error itself, besides that lgtm, @vmarchaud whats your take on this ?
I mean i don't have any issue with adding debug statement to debug an otel behavior but i just wanted to avoid adding debug log to debug http lifecyle in itself. |
I am not going to block this, but adding debug logs for the underlying lifecycle of the http request seems a little odd to me. I can see the issue though if you end a span twice, you don't know there is an error until the second call to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will ✅ when you resolve @obecny's suggestion
Are you going to address @obecny suggestion here? IMO you should either accept the change or make a case why it shouldn't be accepted. The PR will not be merged until conversations are resolved. |
Co-authored-by: Bartlomiej Obecny <[email protected]>
Co-authored-by: Bartlomiej Obecny <[email protected]>
Which problem is this PR solving?
In my case, we got some
Can not execute the operation on ended Span
warnings pointed to outgoing request spans, which I suspect are triggered onresponse.end
event, followed byrequest.close
event which ended the span before. a debug log at this point will be beneficial to understand this behavior.Short description of the changes
Adds a debug log on a request state change