fix(detect_exceptions): replace catch-all rule with targeted patterns for JavaException - #305
fix(detect_exceptions): replace catch-all rule with targeted patterns for JavaException#305vparfonov wants to merge 1 commit into
Conversation
… (LOG-9963, LOG-9995) Fix incorrect multiline exception detection that was merging independent log records. Replace bounded catch-all pattern (^.+$) with 3 targeted patterns: - ^[A-Z]+-?\d+ : Oracle ORA errors, DB error codes - ^[\t ]*\( : Parenthetical continuations - ^[\t ]+\S : Indented lines This allows proper grouping of legitimate multi-line exceptions (stack traces, ORA error codes, nested exceptions) while preventing merger of independent JSON log records with exception keywords (LOG-9963). Fixes LOG-9963, LOG-9995 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/assign @jcantrill |
|
/retest-required |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill, vparfonov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Fix incorrect multiline exception detection that merges independent JSON log records (LOG-9963) while maintaining support for legitimate multi-line exceptions including Java exceptions with non-indented continuation lines like Oracle ORA errors (LOG-9995).
Problem
The
detect_exceptionstransform was using a bounded catch-all regex pattern^.+$to match continuation lines of Java exceptions. While bounded (max 2 lines), this pattern was still too greedy and would matchANYnon-empty line after an exception keyword, causing independent log records to be incorrectly merged into a single event.Example of the bug:
Result: 3 independent messages merged into 1 event
Solution
Replace the generic catch-all with 3 targeted continuation patterns that:
New patterns:
^[A-Z]+-?\d+— Oracle ORA errors, DB error codes (e.g., ORA-12521)^[\t ]*\(— Parenthetical continuations (e.g., CONNECTION_ID)^[\t ]+\S— Indented lines (standard stack frames)These fire from both
JavaAfterExceptionandJavaContinuationstates, allowing proper chaining through the state machine while being selective about what gets merged.Fixes