Improve error reporting for integrated tracking

What does this MR do?

Several improvements for integrated error tracking:

  1. Fix timestamp update when existing error is reported
  2. Exclude description from find_or_create logic
  3. Change text limit on error event from 255 to 1024
  4. 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

Edited by Dmytro Zaporozhets (DZ)

Merge request reports

Loading