Skip to content

Make `sentry_clientside_traces_sample_rate` configurable via admin panel

What does this MR do and why?

As part of #407169 (closed) we want to expose sentry_clientside_traces_sample_rate to be configurable via admin panel, so we can configure Sentry's client side trances sample rate on the fly (PoC in !114281 (closed)). The sample rate is a value between 0 and 1. So we added:

  1. Frontend validation with min: 0, max: 1, step: 0.001
  2. Backend validation (in the DB, code !128336 (merged))

Screenshots or screen recordings

Before After Backend Validation
130147_before 130147_after 130147_backend_validation

How to set up and validate locally

  1. Make sure to enable: Feature.enable(:configure_sentry_in_application_settings)
  2. In the browser
    1. Login as root or any admin user, in your local GDK.
    2. Go to this Admin Page: https://gdk.test:3443/admin/application_settings/metrics_and_profiling
    3. Update the value
  3. Go to rails console
    1. Check the value has been updated: Gitlab::CurrentSettings.sentry_clientside_traces_sample_rate
  4. Alternativelly, apply the change in !130144 (merged) to your local GDK and check gon.sentry_clientside_traces_sample_rate in the browser dev tools

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Miguel Rincon

Merge request reports

Loading