getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.93k stars 4.18k forks source link

Feature Request: Ability to Set Sample Rates via Sentry UI #79437

Open georg78sf opened 4 hours ago

georg78sf commented 4 hours ago

Problem Statement

Currently, there is no option to configure sample rates for different event types, including replays, directly within the Sentry UI. Instead, these settings for error and performance tracking must be specified in the JavaScript code.

This approach presents challenges, especially when needing to adjust sample rates based on changing traffic volumes or scaling needs. In my opinion, such changes should not require code deployments, as they are more operational than developmental in nature.

Furthermore, depending on how a project is structured, updating Sentry initialization code across multiple HTML pages can add unnecessary complexity, especially for teams working with larger or distributed codebases.

Another issue I’ve encountered is browser compatibility when implementing these settings in code. Despite various attempts, I’ve had difficulty preventing errors such as "duplicate initialization" in certain browsers, which complicates deployment.

Here’s an example of the code I'm using:

Sentry.init({
    integrations: [
      Sentry.replayIntegration(),
    ],
    replaysSessionSampleRate: 0.1, // 10% sampling
    replaysOnErrorSampleRate: 1.0,  // 100% sampling when an error occurs
});

It would be highly beneficial to have the ability to manage these settings dynamically from the Sentry UI, without the need to modify and redeploy code. This would significantly streamline the process, especially for teams managing multiple environments or dealing with fluctuating traffic.

Solution Brainstorm

No response

Product Area

Performance

getsantry[bot] commented 4 hours ago

Assigning to @getsentry/support for routing ⏲️