Skip to content

Refactor Sentry initialization

What does this MR do and why?

This change simplifies the Sentry initialization and configuration that's called by the sentry webpack entry point.

It helps centralize all references to @sentry/browser to a single import point.

Screenshots or screen recordings

NA

How to set up and validate locally

One easy way to validate in GDK is to enable Sentry and check it gets configured in the browser console:

  1. Enable the feature flag: enable_new_sentry_integration
  2. Visit http://gdk.test:3000/admin/application_settings/metrics_and_profiling#js-sentry-settings
  3. Fill the form with some dummy data, ensuring "Enable Sentry error tracking" is turned on.
  4. Print the following values in your console:
__SENTRY__.hub._stack[0].client._dsn
__SENTRY__.hub._stack[0].client._options
These are values on my GDK:

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.

Related to #338816 (closed)

Edited by Miguel Rincon

Merge request reports

Loading