Skip to content

RUM-2926: Introduce error.category attribute for exceptions, categorize ANRs separately#1918

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/rum-2926/introduce-error-category-for-anrs
Mar 19, 2024
Merged

RUM-2926: Introduce error.category attribute for exceptions, categorize ANRs separately#1918
0xnm merged 1 commit into
developfrom
nogorodnikov/rum-2926/introduce-error-category-for-anrs

Conversation

@0xnm

@0xnm 0xnm commented Mar 18, 2024

Copy link
Copy Markdown
Member

What does this PR do?

This PR does the following things:

  • Adds error.category attribute, with possible values null|AppHang|ANR|Exception
  • Fills the mentioned attribute when error happens using the following logic: if error is ANR, then value is ANR; if error has throwable attached or non-empty stacktrace - Exception; otherwise it is null.

This property allows better high-level organization of error happening in the application.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm
0xnm requested review from a team as code owners March 18, 2024 09:34
@codecov-commenter

codecov-commenter commented Mar 18, 2024

Copy link
Copy Markdown

Codecov Report

Merging #1918 (f30fd3a) into develop (5d54877) will increase coverage by 0.01%.
Report is 15 commits behind head on develop.
The diff coverage is 92.86%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1918      +/-   ##
===========================================
+ Coverage    83.39%   83.40%   +0.01%     
===========================================
  Files          478      478              
  Lines        17142    17112      -30     
  Branches      2565     2561       -4     
===========================================
- Hits         14295    14272      -23     
+ Misses        2140     2133       -7     
  Partials       707      707              
Files Coverage Δ
...g/android/rum/internal/DatadogLateCrashReporter.kt 84.97% <100.00%> (-0.32%) ⬇️
.../android/rum/internal/domain/scope/RumViewScope.kt 93.33% <100.00%> (-0.54%) ⬇️
...roid/rum/internal/domain/scope/RumResourceScope.kt 94.20% <80.00%> (-0.63%) ⬇️

... and 22 files with indirect coverage changes

Base automatically changed from nogorodnikov/rum-2879/opt-in-non-fatal-anr-reporting to develop March 18, 2024 10:14
attributes.putAll(event.attributes)

val errorCategory =
if (event.stackTrace.isNotEmpty()) ErrorEvent.Category.EXCEPTION else null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the best practice is to add the { } here, is it on one single line though ?

@0xnm
0xnm merged commit 38fb014 into develop Mar 19, 2024
@0xnm
0xnm deleted the nogorodnikov/rum-2926/introduce-error-category-for-anrs branch March 19, 2024 08:41
@0xnm 0xnm mentioned this pull request Mar 19, 2024
3 tasks
@xgouchet xgouchet added this to the 2.7.0 milestone Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants