Introduce ErrorRepository to abstract data access for Error Tracking
What does this MR do and why?
This MR adds ErrorRepository
, a data layer for accessing errors and error events for Category:Error Tracking.
Note this change is behind a feature flag :integrated_error_tracking
.
See Data access layer interface for Error Tracking (#359843 - closed). Refs #358158 (comment 917746138).
Notes:
- This is just a refactor
- We only implement a ActiveRecord strategy
- ClickHouse and more work to be done in e.g. !86544 (closed)
-
ErrorFinder
is removed in favor ofErrorRepository#list_errors
- Individual commits left for review but will be squashed
Screenshots or screen recordings
Still works with Sentry backend and GitLab backend
Backend | Error list | Error details |
---|---|---|
GitLab | ||
Sentry | verified with sentry.gitlab.net |
verified with sentry.gitlab.net |
How to set up and validate locally
- Enable feature flag
integrated_error_tracking
viaFeature.enable(:integrated_error_tracking)
- Via Settings > Monitor > Error Tracking Enable Error Tracking Backend
GitLab
- Create some errors via
FactoryBot.create(:error_tracking_error, project: project)
- Create some error events
- Via console
error = _; FactoryBot.create(:error_tracking_error_event, error: error)
- Via IRB: Setup via
Setnry.init { |config| config.dsn = "<DSN FROM SETTINGS PAGE>" }
and capture an error (not capture message).
- Via console
- Verify via Monitor > Error Tracking
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.
Edited by Peter Leitzen