You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(node): Ensure traces are propagated without spans in Node 22+ (#16221)
Today, if the `httpIntegration` is used without spans (e.g. in a custom
OTEL setup or when setting `httpIntegration({ spans: false })`
manually), outgoing requests will not have traces propagated.
This PR fixes this by using the `http.client.request.created`
diagnostics channel to add the trace headers in this scenario.
However, sadly this channel was only added in Node 22, so it does not
work on versions before that.
I suppose this is still worth adding because it is better than what we
have today (which is that it does not work at all). We may think about
making this work for Node <22, but this would require us monkey patching
http again, which we really do not want to do... Also note that as of
now this should not really affect the vast majority of cases, as unless
you specifically opt out of spans today this will always work as we
always add the otel http instrumentation by default. And in custom otel
setups, users will usually have this set up anyhow. (Also, fetch works
in all environments as expected).
If we want to, in a follow up, avoid adding the otel spans
instrumentation if performance is disabled, we need to think about
this... an option could be to always adding the instrumentation on node
<22, and only skip it on Node 22+. But this can be looked at separately,
this PR at least makes things better than before on Node 22+...
This supersedes
#15735
---------
Co-authored-by: Abhijeet Prasad <[email protected]>
Co-authored-by: Andrei <[email protected]>
0 commit comments