Skip to content

🐛 Browser SDK does not initialize correctly if config for RUM and Logs is not perfectly in sync #3136

Open
@thuringia

Description

@thuringia

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 context shows up as emtpy
  • similarly User is also empty, even if datadogRum.setUser is 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:

  1. Set up logs SDK
  2. Set up RUM SDK
  3. Activate trackSessionAcrossSubdomains in RUM
  4. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions