Skip to content

Use sentry configuration from UI settings

What does this MR do and why?

This change uses Gitlab::CurrentSettings to configure sentry on client when enable_new_sentry_clientside_integration is enabled.

Conversely, it also allows users to disable the old integration sentry by disabling enable_old_sentry_clientside_integration.

When both options are enabled, settings take precedence over config.

Scope

This MR only allows us to override the Sentry configuration from the old to the new integration, unfortunately, it does not allow us to use both simultaneously. More work needs to be done to support 1) Two versions of @sentry/browser at the same time, 2) Make requests to two Sentry instances when every error is reported.

Screenshots or screen recordings

NA

How to set up and validate locally

  1. Enable the two required feature flags:
$ rails c
[1] pry(main)> Feature.enable(:configure_sentry_in_application_settings)
[1] pry(main)> Feature.enable(:enable_new_sentry_clientside_integration)
  1. As admin, enable the settings for Sentry at Admin Area > Metrics and profiling > Sentry (e.g. http://gdk.test:3000/admin/application_settings/metrics_and_profiling#js-sentry-settings)
Screenshot_2022-11-02_at_16.00.02
  1. Confirm the sentry configuration is added to gon object in the browser:
image

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