Install two versions of Sentry Client SDK
-
Review changes -
-
Download -
Patches
-
Plain diff
What does this MR do and why?
This MR is a follow up to !102650 (merged).
It installs two versions of the Sentry browser SDK so we can toggle reporting errors to two a new Sentry instance:
-
Disabled feature flag: Use
Sentry SDK v5
and report to theSentry v9 DSN
in the config (gitlab.yml) -
Enabled feature flag: Use
Sentry SDK v7
and report to theSentry v22+ DSN
in the settings (Admin UI values)
Note
20+ files changed! Wow!
Yes, I've had to change many files but most of the lines changes are small changes
- Move current sentry js files to have a
legacy_
prefix and add the new ones - Add the new Sentry 7 dependency with an alias, which leads to a few changes in webpack and jest config.
- A few repetitive specs for the feature flag state checks.
I've split this change into different MRs, but this last one is the largest one:
Remove unusable Sentry feature flag (!104231 - merged) | |
Move and rename Sentry constants (!104247 - merged) | |
Install two versions of Sentry Client SDK (!102790 - merged) | you are here ![]() |
Use case
This rollout is enabled by having two sets of Sentry settings in our gitlab instance at once, the GitLab instance config (from gitlab.yml
) and the settings (the UI). A rollout could consist of:
- Ensure the Sentry config (e.g. in
gitabl.yml
) is present for the old Sentry instance (v9). - Enable
configure_sentry_in_application_settings
the enable Admin UI Sentry settings. - Visit
/admin/application_settings/metrics_and_profiling
to configure the Sentry settings for the new Sentry instance. - Progressive rollout of
enable_new_sentry_clientside_integration
to users. Users with the feature flag enabled will begin reporting to the new instance.- The recommended rollout method is percentage: 5%, 10%, ...
- Once the rollout is complete, remove the dangling dependencies and remove this feature flag.
Screenshots or screen recordings
Errors appear to be reported the new Sentry instance:
How to set up and validate locally
-
Check out this branch and install run
yarn
. -
This MR installs two versions of the Sentry Browser GDK, so we should test two integrations:
Legacy Integration
-
Ensure the feature flag for the new integration is disabled
Feature.disable(:enable_new_sentry_clientside_integration)
-
Add Sentry (v9) DSN in
gitlab.yml
:
## Error Reporting and Logging with Sentry
sentry:
enabled: true
dsn: https://XXXX@sentry.gitlab.net/1
clientside_dsn: https://XXXX@sentry.gitlab.net/1
environment: 'development'
- Confirm events are captured by the old Sentry instance
New integration
-
Enable the feature flags to enable the new integration and the UI settings panel:
Feature.enable(:enable_new_sentry_clientside_integration)
Feature.enable(:configure_sentry_in_application_settings)
-
Setup the Sentry (newer version) DSN at: http://gdk.test:3000/admin/application_settings/metrics_and_profiling
-
Confirm events are captured by the new Sentry instance
Simulate triggering an error
To ensure I can trigger an error consistently, I added a mock button in `/admin/runners`.
diff --git a/app/assets/javascripts/ci/runner/admin_runners/admin_runners_app.vue b/app/assets/javascripts/ci/runner/admin_runners/admin_runners_app.vue
index 2915e4600855..fd04e7b3e4e1 100644
--- a/app/assets/javascripts/ci/runner/admin_runners/admin_runners_app.vue
+++ b/app/assets/javascripts/ci/runner/admin_runners/admin_runners_app.vue
@@ -1,4 +1,5 @@
<script>
+import * as Sentry from '@sentry/browser';
import { GlLink } from '@gitlab/ui';
import { createAlert } from '~/flash';
import { updateHistory } from '~/lib/utils/url_utility';
@@ -152,6 +153,9 @@ export default {
onPaginationInput(value) {
this.search.pagination = value;
},
+ reportError() {
+ Sentry.captureException(new Error('test error'));
+ },
},
filteredSearchNamespace: ADMIN_FILTERED_SEARCH_NAMESPACE,
INSTANCE_TYPE,
@@ -160,6 +164,7 @@ export default {
</script>
<template>
<div>
+ <gl-link @click="reportError">Report Error Here!</gl-link>
<div
class="gl-display-flex gl-align-items-center gl-flex-direction-column-reverse gl-md-flex-direction-row gl-mt-3 gl-md-mt-0"
>
After I visit http://gdk.test:3000/admin/runners to report an error on each click.
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.
Merge request reports
- version 2921faf634
- version 2855438303
- version 27bebf45f4
- version 261c0e3506
- version 25c4a4af83
- version 247f39b974
- version 239deb13aa
- version 229deb13aa
- version 213693b8f7
- version 203693b8f7
- version 19fb74323c
- version 183c32d788
- version 173c32d788
- version 16eddb5367
- version 1541320293
- version 14cd8c7604
- version 13eb5ab556
- version 129197ce92
- version 11b28863f5
- version 1009d96366
- version 909d96366
- version 8d44709f7
- version 7d44709f7
- version 6d44709f7
- version 5d44709f7
- version 4d44709f7
- version 38f28076c
- version 205b19c5b
- version 137d42638
- master (base)
- latest version80e500fd7 commits,
- version 2921faf6346 commits,
- version 28554383036 commits,
- version 27bebf45f45 commits,
- version 261c0e35065 commits,
- version 25c4a4af834 commits,
- version 247f39b9743 commits,
- version 239deb13aa2 commits,
- version 229deb13aa2 commits,
- version 213693b8f72 commits,
- version 203693b8f73 commits,
- version 19fb74323c3 commits,
- version 183c32d7883 commits,
- version 173c32d7883 commits,
- version 16eddb53673 commits,
- version 15413202932 commits,
- version 14cd8c76042 commits,
- version 13eb5ab5562 commits,
- version 129197ce922 commits,
- version 11b28863f52 commits,
- version 1009d963662 commits,
- version 909d963662 commits,
- version 8d44709f73 commits,
- version 7d44709f73 commits,
- version 6d44709f73 commits,
- version 5d44709f73 commits,
- version 4d44709f72 commits,
- version 38f28076c2 commits,
- version 205b19c5b2 commits,
- version 137d426382 commits,
- Side-by-side
- Inline