Skip to content

Tweak aei limits#2012

Merged
fractalwrench merged 4 commits intomainfrom
aei-limit-tweaks
Mar 11, 2025
Merged

Tweak aei limits#2012
fractalwrench merged 4 commits intomainfrom
aei-limit-tweaks

Conversation

@fractalwrench
Copy link
Copy Markdown
Member

Goal

Tweaks the limits for AEI capture, so that a maximum of 64 can be processed & sent in one session, and so the trace limit is 10Mb uncompressed. The intent behind this change is to improve the deliverability of NDK crash traces.

Testing

Updated existing test coverage.

@fractalwrench fractalwrench requested a review from a team as a code owner March 10, 2025 15:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.25%. Comparing base (f0dfd53) to head (33dcf28).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...nternal/config/behavior/AppExitInfoBehaviorImpl.kt 0.00% 0 Missing and 1 partial ⚠️
...bracesdk/internal/capture/aei/AeiDataSourceImpl.kt 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2012   +/-   ##
=======================================
  Coverage   85.25%   85.25%           
=======================================
  Files         464      464           
  Lines       10502    10512   +10     
  Branches     1550     1554    +4     
=======================================
+ Hits         8953     8962    +9     
  Misses        875      875           
- Partials      674      675    +1     
Files with missing lines Coverage Δ
...roid/embracesdk/internal/arch/schema/SchemaType.kt 99.30% <100.00%> (+<0.01%) ⬆️
...sdk/internal/opentelemetry/EmbraceAttributeKeys.kt 100.00% <100.00%> (ø)
...acesdk/internal/prefs/EmbracePreferencesService.kt 93.91% <100.00%> (+0.05%) ⬆️
...nternal/config/behavior/AppExitInfoBehaviorImpl.kt 75.00% <0.00%> (-2.78%) ⬇️
...bracesdk/internal/capture/aei/AeiDataSourceImpl.kt 97.05% <88.88%> (-2.95%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


private companion object {
private const val SDK_AEI_SEND_LIMIT = 32
private const val SDK_AEI_SEND_LIMIT = 64
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this limit apply for all AEIs? Any chance we can make it so that native crashes don't respect this limit?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the maximum number of AEI we request from the OS on each process launch. In practice AEI is only recorded after a process terminates so most of the time I'd expect the number of AEI sent to equal 1.

So assuming Embrace is enabled 100% of the time, the SDK will get 64 process launches where it can attempt to capture data before dropping anything. I wouldn't like to make this unbounded as there is a resource cost in capturing each AEI object

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

And unfortunately the Android API doesn't provide a way to query just for crashes/ANRs, which would make our lives much simpler...

Copy link
Copy Markdown
Contributor

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM. Do we know if Google has a limit as to how big their AEI uploads could be?

@fractalwrench
Copy link
Copy Markdown
Member Author

LGTM. Do we know if Google has a limit as to how big their AEI uploads could be?

IIRC it's something like 20Mb on-device for a tombstone, but I'd anticipate most tombstones being much smaller than that

@fractalwrench fractalwrench merged commit b57caf9 into main Mar 11, 2025
10 checks passed
@fractalwrench fractalwrench deleted the aei-limit-tweaks branch March 11, 2025 16:02
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.

3 participants