Skip to content

Add new setting for performance tracing sample rate

Background

In !114281 (closed) we have a POC which shows how the performance tracing of Sentry works.

The payloads for performance analysis are large, and a sampling rate can be defined on the client.

Problem Statement

This feature cannot be enabled directly as adjusting the sampling rate on the fly is very important for the reliability of our Sentry instance.

Our setting at /admin/application_settings/metrics_and_profiling require a restart to work.

Screenshot_2023-04-13_at_12.52.34

Proposed Solution

Two changes are needed for our performance tracking to be possible:

  • Settings should be updated without requiring a restart
  • A new application_setting_sentry_clientside_traces_sample_rate setting should be added to our settings.

MRs that implement this solution

MR Description
!128336 (merged) Add sentry_clientside_traces_sample_rate app setting
!130144 (merged) Add sentry_clientside_traces_sample_rate setting to gon
!130147 (merged) Make sentry_clientside_traces_sample_rate configurable via admin panel

Conclusion

With the MRs all merged, we've achieved the goal of this issue:

  1. To edit the new setting:
    1. Make sure the Feature Flag configure_sentry_in_application_settings is enabled
    2. Go to admin panel /admin/application_settings/metrics_and_profiling
    3. In the Sentry section, edit the Clientside traces sample rate field
    4. Click Save changes button after editing.
    5. A full page reload will give the success/rejection save message
  2. To use the new setting:
    1. Make sure the Feature Flag enable_new_sentry_clientside_integration is enabled and Gitlab::CurrentSettings.sentry_enabled is true
    2. In the frontend check the value of window.gon.sentry_clientside_traces_sample_rate
Edited by Sheldon Led