Install two versions of Sentry Client SDK
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
Activity
assigned to @mrincon
2 Warnings This merge request is quite big (904 lines changed), please consider splitting it into multiple merge requests. 156e7854: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines. Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Mario Celi (
@mcelicalderonG
) (UTC-5, 6 hours behind@mrincon
)Sean McGivern (
@smcgivern
) (UTC+0, 1 hour behind@mrincon
)frontend Janis Altherr (
@janis
) (UTC+1, same timezone as@mrincon
)Kushal Pandya (
@kushalpandya
) (UTC+5.5, 4.5 hours ahead of@mrincon
)test for spec/features/*
Aleksandr Lyubenkov (
@alyubenkov
) (UTC+1, same timezone as@mrincon
)Maintainer review is optional for test for spec/features/*
Application Security Reviewer review is optional for Application Security Nikhil George (
@ngeorge1
) (UTC+0, 1 hour behind@mrincon
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger- Resolved by 🤖 GitLab Bot 🤖
Proper labels assigned to this merge request. Please ignore me.
@mrincon - please see the following guidance and update this merge request.1 Error Please add typebug typefeature, or typemaintenance label to this merge request. Edited by 🤖 GitLab Bot 🤖
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
Setting label grouprunner based on
@mrincon
's group.added grouprunner label
added devopsverify sectionops labels
added maintenanceworkflow typemaintenance labels
changed milestone to %15.6
Allure report
allure-report-publisher
generated test report!e2e-review-qa:
test report for 80e500fdexpand test summary
+-----------------------------------------------------------------------------------------+ | suites summary | +------------------------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------------------------+--------+--------+---------+-------+-------+--------+ | Verify | 12 | 0 | 1 | 0 | 13 | ✅ | | Manage | 39 | 0 | 4 | 3 | 43 | ❗ | | Plan | 49 | 0 | 1 | 0 | 50 | ✅ | | Create | 28 | 0 | 1 | 0 | 29 | ✅ | | Package | 0 | 0 | 1 | 0 | 1 | ➖ | | Feature flag handler sanity checks | 9 | 0 | 0 | 0 | 9 | ✅ | | Govern | 10 | 0 | 5 | 1 | 15 | ❗ | | Configure | 0 | 0 | 1 | 0 | 1 | ➖ | | Version sanity check | 0 | 0 | 1 | 0 | 1 | ➖ | +------------------------------------+--------+--------+---------+-------+-------+--------+ | Total | 147 | 0 | 15 | 4 | 162 | ❗ | +------------------------------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for 80e500fdexpand test summary
+---------------------------------------------------------------------------+ | suites summary | +----------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +----------------------+--------+--------+---------+-------+-------+--------+ | Manage | 351 | 0 | 27 | 3 | 378 | ❗ | | Plan | 312 | 0 | 0 | 0 | 312 | ✅ | | Create | 818 | 0 | 27 | 2 | 845 | ❗ | | Govern | 209 | 0 | 0 | 0 | 209 | ✅ | | Package | 144 | 0 | 37 | 0 | 181 | ✅ | | Verify | 229 | 0 | 42 | 0 | 271 | ✅ | | Fulfillment | 10 | 0 | 75 | 0 | 85 | ✅ | | Release | 30 | 0 | 0 | 0 | 30 | ✅ | | Monitor | 5 | 0 | 0 | 0 | 5 | ✅ | | Analytics | 11 | 0 | 0 | 0 | 11 | ✅ | | ModelOps | 0 | 0 | 5 | 0 | 5 | ➖ | | Secure | 30 | 0 | 10 | 1 | 40 | ❗ | | GitLab Metrics | 2 | 0 | 1 | 1 | 3 | ❗ | | Systems | 3 | 0 | 0 | 0 | 3 | ✅ | | Data Stores | 13 | 0 | 1 | 0 | 14 | ✅ | | Configure | 1 | 0 | 15 | 0 | 16 | ✅ | | Version sanity check | 0 | 0 | 7 | 4 | 7 | ➖ | +----------------------+--------+--------+---------+-------+-------+--------+ | Total | 2168 | 0 | 247 | 11 | 2415 | ❗ | +----------------------+--------+--------+---------+-------+-------+--------+
mentioned in merge request !102650 (merged)
- A deleted user
added feature flag label
- Resolved by Miguel Rincon
Bundle size analysis [beta]
This compares changes in bundle size for entry points between the commits 725e7136 and 80e500fd
Special assetsEntrypoint / Name Size before Size after Diff Diff in percent average 3.55 MB 3.44 MB -121.42 KB -3.3 % mainChunk 1.96 MB 1.84 MB -118.67 KB -5.9 % Significant Growth: 1Expand
Entrypoint / Name Size before Size after Diff Diff in percent sentry 171.13 KB 262.23 KB +91.1 KB 53.2 % New entry points: 1Expand
Entrypoint / Name Size before Size after Diff Diff in percent legacy_sentry 0 Bytes 293.41 KB +293.41 KB 100.0 %
Your MR has at least one entrypoint growing significantly (more > 1 KB or 2%). If you write new or extend existing features, this is expected and there is nothing to worry about.
Please consider pinging someone from the FE Foundations (
@leipert
,@markrian
,@mikegreiling
,@ohoral
or@pgascouvaillancourt
) for review, if you are unsure about the size increase.Note: We do not have exact data for 725e7136. So we have used data from: 4a957259.
The target commit was too new, so we used the latest commit from master we have info on.
It might help to rerun thebundle-size-review
job
This might mean that you have a few false positives in this report. If something unrelated to your code changes is reported, you can check this comparison in order to see if they caused this change.Please look at the full report for more details
Read more about how this report works.
Generated by
Danger
added 2402 commits
-
9197ce92...9a70d808 - 2400 commits from branch
master
- afc6e29b - Move sentry constants to separate file
- eb5ab556 - Install two versions of Sentry
-
9197ce92...9a70d808 - 2400 commits from branch
- Resolved by Lukas Eipert
- Resolved by Lukas Eipert
- Resolved by Miguel Rincon
- Resolved by Miguel Rincon
- Resolved by Miguel Rincon
- Resolved by Mike Greiling
@leipert could you help have a first MR? Some ruby tests are missing bu it would be great to have your opinion on the approach I used here. @mikegreiling, feel free to join as well
cc @samdbeckham
requested review from @leipert
mentioned in issue #382570 (closed)
added WorkingGroupFrontendObservability label
- Resolved by Miguel Rincon
- Resolved by Miguel Rincon
- Resolved by Miguel Rincon
- Resolved by Lukas Eipert
- Resolved by Miguel Rincon
added 1 commit
- 3c32d788 - Load only one sentry version to reduce bundle size
requested review from @kmorrison1
added 304 commits
-
3c32d788...6dd9b118 - 301 commits from branch
mrincon-sentry-remove-unsable-feature-flag
- 2aeb0f63 - Move sentry constants to separate file
- 16118924 - Install two versions of Sentry
- fb74323c - Load only one sentry version to reduce bundle size
Toggle commit list-
3c32d788...6dd9b118 - 301 commits from branch
added 1 commit
- 9deb13aa - Load only one sentry version to reduce bundle size
mentioned in merge request !104247 (merged)
mentioned in merge request !104231 (merged)
requested review from @dcouture
removed review request for @kmorrison1
added 114 commits
-
9deb13aa...fe113efd - 111 commits from branch
master
- 81c43b50 - Install two versions of Sentry
- 7d29479e - Load only one sentry version to reduce bundle size
- 7f39b974 - Improve test coverage for CSP
Toggle commit list-
9deb13aa...fe113efd - 111 commits from branch
- Resolved by Miguel Rincon
added 1 commit
- c4a4af83 - Remove sentry SDK duplicated package.json entry
removed review request for @dcouture
@dcouture
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
requested review from @mikegreiling
@jon_jenkins can you help me review change? Thanks!
requested review from @jon_jenkins
- Resolved by Miguel Rincon
@richard.chong can you help me review this change? Thanks!
requested review from @richard.chong
- Resolved by Jon Jenkins
- Resolved by Miguel Rincon
- Resolved by Miguel Rincon
- Resolved by Miguel Rincon
Thanks for giving me the opportunity to review this MR, Miguel!
I had a couple of small comments and suggestions. Please let me know if you have any questions.
changed milestone to %15.7
added missed:15.6 label
added 613 commits
-
55438303...79761cbc - 607 commits from branch
master
- 1e90b3bd - Install two versions of Sentry
- 88acb457 - Load only one sentry version to reduce bundle size
- 2bf1b5fb - Improve test coverage for CSP
- cb648c15 - Remove sentry SDK duplicated package.json entry
- f254a626 - Add tests to wrapper and fix failures
- 21faf634 - Address review comments
Toggle commit list-
55438303...79761cbc - 607 commits from branch
- Resolved by Miguel Rincon
mentioned in issue #383349
removed review request for @leipert
removed review request for @richard.chong
mentioned in issue #383551
- Resolved by Miguel Rincon
removed review request for @mikegreiling
@mrincon looks good to me as well! Thanks!
removed review request for @jon_jenkins
added 435 commits
-
21faf634...7cb80375 - 428 commits from branch
master
- dfc3f50e - Install two versions of Sentry
- 9d4a2fc6 - Load only one sentry version to reduce bundle size
- e1e51772 - Improve test coverage for CSP
- 8ed99486 - Remove sentry SDK duplicated package.json entry
- 156e7854 - Add tests to wrapper and fix failures
- 7df55747 - Address review comments
- 80e500fd - Upgrade to latest Sentry 7 and make version checks
Toggle commit list-
21faf634...7cb80375 - 428 commits from branch
requested review from @mikegreiling
- Resolved by Mike Greiling
@smcgivern
could you do our backend maintainer review here? Thanks!
requested review from @smcgivern
- Resolved by Sean McGivern
- Resolved by Sean McGivern
removed review request for @smcgivern
@mikegreiling, did you forget to run a pipeline before you merged this work? Based on our code review process, if the latest pipeline finished more than 2 hours ago, you should:
- Ensure the merge request is not in Draft status.
- Start a pipeline (especially important for Community contribution merge requests).
- Set the merge request to merge when pipeline succeeds.
This is a guideline, not a rule. Please consider replying to this comment for transparency.
This message was generated automatically. You're welcome to improve it.
mentioned in commit e810e626
mentioned in commit 6dcf7ca2
mentioned in merge request !105252 (merged)
mentioned in merge request !105323 (closed)
mentioned in merge request !105324 (merged)
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!1748 (merged)