DEV Community

Discussion on: Tracing requests in Node.js?

Collapse
 
marcelchastain profile image
Marcel Chastain

Late to the discussion, but as of Aug 2020 there's an excellent option.
cls-rtracer v2 uses the native AsyncLocalStorage API, which should be more robust than cls-hooked.

If you still run into issues losing your thread context, there was also mention that a potential workaround was to re-order your middleware.

Good luck!