Merge Sentry's contexts and users into Application Context
requested to merge qmnguyen0711/846-sentry-merge-sentry-s-contexts-and-users-into-applicationcontext into master
What does this MR do?
A part of gitlab-com/gl-infra/scalability#846 (closed), and a part of gitlab-com/gl-infra&396 (closed) epic.
This MR is to merge Sentry's own context stack into Gitlab::ApplicationContext and refactor Gitlab::ErrorTracking to extract the functionalities into dedicated modules. We also want to make sure all logic related to Error Tracking staying unchanged. In detail:
- Remove
Gitlab::ApplicaionContext#with_context
. - Remove all direct accesses to
Raven#capture_exception
. - Move logging-related logic to
Gitlab::ErrorTracking::LogFormatter
. - Utilize context payload in manually-created events, auto-captured event, and loggger.
As a result of the merger, all events captured by Sentry built-in integrations now include application-context tags and user information, especially feature_category
.
Screenshots (strongly suggested)
Exception captured in API handlers
Exception captured in GraphQL Controller
Exception captured in a Web Controller (captured automatically)
Exception captured in a Web Controller (captured manually)
Exception captured in a Worker (captured manually)
Exception captured in a Worker (captured automatically)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Quang-Minh Nguyen