DataDog / dd-trace-js

JavaScript APM Tracer
https://docs.datadoghq.com/tracing/
Other
646 stars 305 forks source link

`dd-trace` cannot propagate `x-datadog-*` header when Mock Service Worker (MSW) is activated #3334

Open Chanki-Min opened 1 year ago

Chanki-Min commented 1 year ago

dd-trace seems like not working well with MSW library, that used with many companies to make mocked response

Expected behaviour

dd-trace should be able to catch outgoing http.request. And add x-datadog-* headers to be able to track Distributed Tracing

Actual behaviour

When MSW (Mock Service Worker) is enabled in Node.js Server with bypass mode (bypasses request that do not match with mocking handers), bypassed outgoing request is not captured by dd-trace. and x-datadog-* header is not attached

Steps to reproduce I made reproduction repository. Please clone that repository and follow reproduction steps in README.md

Environment

Package.json is in reproduction repository

kettanaito commented 1 year ago

Let me know if I can help in any way. I don't expect this to be an issue in MSW/Interceptors but ping me if it is.