Open ValerieNayak opened 2 months ago
Hi @ValerieNayak , Would you mind to give us your init script or process (NPM, CDN async, etc.)? It looks like multiple sdks have been initiated. If you need help on setting up, do not hesitate to reach out to Datadog Support.
Hi @cy-moi, thanks for your reply. We are initializing using NPM. We have already ruled out multiple initiations because we set a breakpoint at the init step in the code and confirmed that it is only being hit once. With additional breakpoints, we've identified that a single request is being traced through both traceFetch
and traceXhr
.
Upon further investigation, we've seen that we're using isomorphic-fetch
and this turns a fetch request into an xhr request. According to MDN dev docs on XMLHttpRequest: setRequestHeader()
method,
If this method is called several times with the same header, the values are merged into one single request header.
Could we have it so Datadog is not double tracing in this case?
Hi @ValerieNayak ,
Thank you for reporting this. This is indeed a limitation of ours and we value your feedback very much. You can report a feature request with Datadog Support to help us prioritizing it.
Describe the bug A clear and concise description of what the bug is and on which product (
rum
,logs
).This issue occurs on
rum
. Some requests generate headers in bothtraceXhr
andtraceFetch
. These requests have duplicate headers.To Reproduce Steps to reproduce the behavior:
We know the steps are being processed through both traceXhr and traceFetch, but we don't have a reproduction at this point.
Expected behavior A clear and concise description of what you expected to happen.
We expect that a single request outputs a single trace ID in request headers.