Skip to content

Feature: Configuration for capturing "Console" and "Network" data #7463

@billyvg

Description

@billyvg

Problem

Some users want to be able to control what gets captured in the Console and Network tabs (for example, privacy reasons).

We should add configuration options to replay to:

  • enable/disable capturing of Console messages
  • enable/disable capturing of Network data
  • capture specific console log levels (log, info, debug, warn, error)
  • capture specific network types (css, script, img, link, fetch, xhr, other)

Proposal

I'm not familiar with other parts of the SDK but this API should be consistent with existing patterns if possible:

Single key

new Replay({
  captureConsole: true,      // Default, capture everything
  captureConsole: false,     // Do not capture any console logs
  captureConsole: ['error'], // Capture only `console.error()`
});

Multiple keys

new Replay({
  disableCaptureConsole: false, // Default, capture everything
  disableCaptureConsole: true,  // Do not capture any console logs
  captureConsole: ['error'],    // Capture only `console.error()`
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: replayIssues related to the Sentry Replay SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions