ref(node): Refactor some otel internals in http integrations#22292
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e9ba2e. Configure here.
| response.resume(); | ||
| } | ||
| setIncomingResponseSpanData(response, span); | ||
| bindScopeToEmitter(response); |
There was a problem hiding this comment.
Response binding omits active span
Medium Severity
Outgoing HTTP responses call bindScopeToEmitter without first activating the outgoing http.client span. bindScopeToEmitter freezes whatever scope is current at bind time, but that span is created via startInactiveSpan, so listeners on the response stream later run without that span active and child spans can attach to the wrong parent.
Reviewed by Cursor Bugbot for commit 2e9ba2e. Configure here.
There was a problem hiding this comment.
this is fine and also how it was before, the emitter should not have the span as parent as that could break parent-child relationships 🤔
size-limit report 📦
|


This refactors some http integration internals to use core APIs instead of OTEL APIs:
bindScopeToEmitterdirectly now for outgoing requests, this is no longer OTEL specific and thus does not need to be in node-core specifically