Improve error reporting for integrated tracking
What does this MR do?
Several improvements for integrated error tracking:
- Fix timestamp update when existing error is reported
- Exclude description from find_or_create logic
- Change text limit on error event from 255 to 1024
- Store exception message as event description
Integrated error tracking is a new feature that is behind a feature flag and is disabled by default.
Issue #329596 (closed)
Database migrations
rake db:migrate
== 20210825104558 ChangeDescriptionLimitErrorTrackingEvent: migrating =========
-- execute("ALTER TABLE error_tracking_error_events\nDROP CONSTRAINT IF EXISTS check_92ecc3077b\n")
-> 0.0020s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0003s
-- execute("ALTER TABLE error_tracking_error_events\nADD CONSTRAINT check_92ecc3077b\nCHECK ( char_length(description) <= 1024 )\nNOT VALID;\n")
-> 0.0076s
-- current_schema()
-> 0.0002s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- execute("ALTER TABLE error_tracking_error_events VALIDATE CONSTRAINT check_92ecc3077b;")
-> 0.0013s
-- execute("RESET statement_timeout")
-> 0.0007s
== 20210825104558 ChangeDescriptionLimitErrorTrackingEvent: migrated (0.0490s) rake db:rollback
== 20210825104558 ChangeDescriptionLimitErrorTrackingEvent: reverting =========
-- execute("ALTER TABLE error_tracking_error_events\nDROP CONSTRAINT IF EXISTS check_92ecc3077b\n")
-> 0.0011s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0003s
-- execute("ALTER TABLE error_tracking_error_events\nADD CONSTRAINT check_92ecc3077b\nCHECK ( char_length(description) <= 255 )\nNOT VALID;\n")
-> 0.0023s
-- current_schema()
-> 0.0003s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- execute("ALTER TABLE error_tracking_error_events VALIDATE CONSTRAINT check_92ecc3077b;")
-> 0.0011s
-- execute("RESET statement_timeout")
-> 0.0005s
== 20210825104558 ChangeDescriptionLimitErrorTrackingEvent: reverted (0.0332s) Screenshots or Screencasts (strongly suggested)
No UI changes
Does this MR meet the acceptance criteria?
Conformity
- I have included changelog trailers, or none are needed. (Does this MR need a changelog?)
- [-] I have added/updated documentation, or it's not needed. (Is documentation required?)
- [-] I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?)
- I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?)
- I have self-reviewed this MR per code review guidelines.
- This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines)
- I have followed the style guides.
- This change is backwards compatible across updates, or this does not apply.
Edited by Dmytro Zaporozhets (DZ)