diff options
Diffstat (limited to 'qa/qa/support/json_formatter.rb')
-rw-r--r-- | qa/qa/support/json_formatter.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qa/qa/support/json_formatter.rb b/qa/qa/support/json_formatter.rb index 252ccfe73d3..178b76e1974 100644 --- a/qa/qa/support/json_formatter.rb +++ b/qa/qa/support/json_formatter.rb @@ -26,6 +26,10 @@ module QA class: exception.class.name, message: exception.message, message_lines: strip_ansi_codes(notification.message_lines), + correlation_id: exception.message[match_data_after(Loglinking::CORRELATION_ID_TITLE)], + sentry_url: exception.message[match_data_after(Loglinking::SENTRY_URL_TITLE)], + kibana_discover_url: exception.message[match_data_after(Loglinking::KIBANA_DISCOVER_URL_TITLE)], + kibana_dashboard_url: exception.message[match_data_after(Loglinking::KIBANA_DASHBOARD_URL_TITLE)], backtrace: notification.formatted_backtrace } end @@ -70,6 +74,10 @@ module QA modified = Array(strings).map { |string| string.dup.gsub(/\x1b\[{1,2}[0-9;:?]*m/m, '') } modified.size == 1 ? modified[0] : modified end + + def match_data_after(title) + /(?<=#{title} ).*/ + end end end end |