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
- 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)
- 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)
- Confirm the sentry configuration is added to
gon
object in the browser:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.