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
Following this DataDog/dd-trace-js#1642 (comment)
Looks like to have full visibility and have good APM instrumentation, the APM agent should know when the request actually finished, including reading the body from the socket.
Do you have any thoughts or ideas on what is the right way to implement it?
AFAIK the body object always be consumed or cancelled according to the docs, so the right direction to look on is the Readable object
IMO just sending an event from "ConsumeFinish" is not enough since it will need some reference on the request itself to be able to finish the right span which currently is missing on Readable
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Following this DataDog/dd-trace-js#1642 (comment)
Looks like to have full visibility and have good APM instrumentation, the APM agent should know when the request actually finished, including reading the body from the socket.
Do you have any thoughts or ideas on what is the right way to implement it?
AFAIK the body object always be consumed or cancelled according to the docs, so the right direction to look on is the Readable object
Specifically these parts:
https://github.com/nodejs/undici/blob/main/lib/api/readable.js#L41-L56 - Destroy
https://github.com/nodejs/undici/blob/main/lib/api/readable.js#L266-L283 - ConsumeFinish
IMO just sending an event from "ConsumeFinish" is not enough since it will need some reference on the request itself to be able to finish the right span which currently is missing on
Readable
Beta Was this translation helpful? Give feedback.
All reactions