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
Hi, I am not sure if this is the right forum to ask this question, but I since Node.js diagnostics_channel seems to fall under this working group I got here.
As of today, according to the Node.js docs there are two HTTP built-in channels for client events: http.client.request.start and http.client.response.finish.
Looking at the Node.js http module implementation, and after some tests it appears that there might be a gap in the events.
Subscribers can get notified when a request starts and when a response arrives, but there seems to not be a channel to subscribe for when the request fails (i.e. in the event of a ECONNREFUSED).
I am experimenting with tracing requests made with the http and https modules without having to patch the modules directly (which would require a loader with ESM) and without this type of channel/event if the request is going to fail any span created on http.client.request.start will remain orphaned & opened.
The fetch module has similar channels, but also has a undici:request:error channel that can be used for this.
Is the lack of this channel for the built-in HTTP events intentional? Am I misinterpreting entirely why these channels are there in the first place?
The text was updated successfully, but these errors were encountered:
I'll spend some time understanding what would be the appropriate process to propose this, in the meanwhile I'd be interested - if possible - to hear how other APM vendors are approaching the problem of instrumenting http requests with ESM.
I'm familiar with loader-based approaches like import-in-the-middle and I am wondering if there's any other approach that you have seen.
http is a built in module and not ESM so besides ESM customization hooks it should be also possible to use old style monkey patching.
Clearly all this approach to monkey patch node internals, rewrite imported files, change import graph go hand in hand with risk.
Hi, I am not sure if this is the right forum to ask this question, but I since Node.js
diagnostics_channel
seems to fall under this working group I got here.As of today, according to the Node.js docs there are two HTTP built-in channels for client events:
http.client.request.start
andhttp.client.response.finish
.Looking at the Node.js http module implementation, and after some tests it appears that there might be a gap in the events.
Subscribers can get notified when a request starts and when a response arrives, but there seems to not be a channel to subscribe for when the request fails (i.e. in the event of a
ECONNREFUSED
).I am experimenting with tracing requests made with the
http
andhttps
modules without having to patch the modules directly (which would require a loader with ESM) and without this type of channel/event if the request is going to fail any span created onhttp.client.request.start
will remain orphaned & opened.The
fetch
module has similar channels, but also has a undici:request:error channel that can be used for this.Is the lack of this channel for the built-in HTTP events intentional? Am I misinterpreting entirely why these channels are there in the first place?
The text was updated successfully, but these errors were encountered: