Skip to content

Multiple app instances appear as the same session in Datadog RUM #3997

@3Dayg

Description

@3Dayg

Describe the bug

I am using the library @datadog/browser-rum version 6.22.0, and I noticed that when I open multiple instances of my React app (e.g., in two different tabs or two different instances of chrome), the data collected in Datadog appears as part of the same session, when in fact they are 2 different ones, this causes huge headaches and noise when trying to follow a user journey for debugging.

Based on the documentation's definition of a session, this behavior seems incorrect or ambiguous. The documentation defines a session as "unique user journey":

All RUM data refers to user or synthetics sessions, which are at the top of the event hierarchy. A session is a unique user journey and encompasses everything (for example, pages viewed, views, clicks, scrolls, and errors) the user triggered. A session can last up to four hours of continuous activity, or it can expire after 15 minutes of inactivity. Since a session encompasses the entire journey, all attributes tied to that user are also tied to that session. For example, you may want to query on a default attribute, like action count, then add something more custom, like user attributes.

https://docs.datadoghq.com/real_user_monitoring/guide/understanding-the-rum-event-hierarchy/

To Reproduce
Steps to reproduce the behavior:

  1. Open a React app that uses @datadog/browser-rum version 6.22.0.
  2. Open the app in two different tabs or two different browsers.
  3. Perform actions in both instances of the app.
  4. Observe that the data collected in Datadog appears as part of the same session. If i get this right it can also be
    checked running this on console:
    DD_RUM.getInternalContext().session_id

Expected behavior
I expected each instance of the app (e.g., in different tabs or browsers) to generate separate sessions in Datadog, as they represent distinct user journeys. Alternatively, if this behavior is intentional, the documentation should provide clearer guidance on how session IDs are determined and why this behavior occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions