🐛 Browser SDK does not initialize correctly if config for RUM and Logs is not perfectly in sync
Describe the bug This issue seems to primarily affect RUM, but should apply to Logs as well. I detected it in our application because RUM did not initialize correctly.
The issue is that if only one of the SDKs is configured with trackSessionAcrossSubdomains the required _dd_s cookie exists twice. This leads to inconsistent behavior.
Logs appears to initialize just fine, and will send data to the intake.
Rum does not:
- the browser extension shows the correct data in
configuration - but
internal contextshows up as emtpy - similarly
Useris also empty, even ifdatadogRum.setUseris called.
When running RUM and Logs from CDN, calling window.DD_RUM.getInternalContext() returns undefined
This behavior does not appear to fully prevent RUM from initializing, a small set of users did continue to send/create RUM data. In our case it looked to be about 10%.
To Reproduce Steps to reproduce the behavior:
- Set up logs SDK
- Set up RUM SDK
- Activate
trackSessionAcrossSubdomainsin RUM - RUM will stop working
Expected behavior I think the docs should be updated to mention that this setting in particular needs to be in sync. Additionally a real error, or debug message would be nice, if the SDK detects an inconsistent config, or fails to initialize at all.
Big thank you for making the Chrome extension, it was extremely helpful in debugging this!
Hello @thuringia, Thanks for you feedback! Yes, the RUM and Logs SDKs have to be in sync for a sub set of initialization options to work properly. There is a subtle mention about it in the public doc but I agree, we could improve it! I'll bring this topic to the team to see what can be done.