Install two versions of Sentry Client SDK
All threads resolved!
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:
Sentry SDK v5
and report to the Sentry v9 DSN
in the config (gitlab.yml)Sentry SDK v7
and report to the Sentry v22+ DSN
in the settings (Admin UI values)20+ files changed! Wow!
Yes, I've had to change many files but most of the lines changes are small changes
legacy_
prefix and add the new onesI'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 ![]() |
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:
gitabl.yml
) is present for the old Sentry instance (v9).configure_sentry_in_application_settings
the enable Admin UI Sentry settings./admin/application_settings/metrics_and_profiling
to configure the Sentry settings for the new Sentry instance.enable_new_sentry_clientside_integration
to users. Users with the feature flag enabled will begin reporting to the new instance.
Errors appear to be reported the new Sentry instance:
Check out this branch and install run yarn
.
This MR installs two versions of the Sentry Browser GDK, so we should test two integrations:
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'
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
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.
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.