Skip to content

Support Multiple Datadog Browser Log Instances with Independent Session Management #3121

Open
@naseemkullah

Description

@naseemkullah

Problem Statement

In monolithic frontend applications where multiple teams require distinct Datadog browser log instances, the current session management (based on a shared cookie) prevents setting unique sample rates and configurations for each instance. This limitation affects our ability to monitor different functionalities independently, as the sample rate and session data are applied globally across all instances, rather than on a per-instance basis.

Proposed Solution

Introduce a cookieName or namespace parameter for datadogLogs.init, allowing each instance to maintain isolated session data, sample rates, and configurations. By providing unique identifiers, teams could independently monitor specific functionalities without global session overlap.

Potential API:

datadogLogs.init({
  clientToken: 'your-client-token',
  site: 'datadoghq.com',
  service: 'my-service',
  sampleRate: 50,
  cookieName: 'dd_logs_teamA', // Custom cookie for team A's logs
  namespace: 'teamA_logs',     // Alternative: unique namespace
});

This change would enhance Datadog's usability for large, multi-team applications by supporting more granular, instance-specific logging configurations.

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