Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak data source warning #876

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

fractalwrench
Copy link
Contributor

Goal

Tweaks the log level & text shown when the data capture limit is reached in DataSourceImpl. This caused a bit of confusion so a lower severity level & clearer message is desirable. I've also altered the message to include the class name that has run into the limit.

Testing

Relied on existing test coverage & also tested out message manually in the test app:

Data capture limit reached for io.embrace.android.embracesdk.capture.crumbs.BreadcrumbDataSource. Ignoring to keep payload size reasonable - other data types will still be captured normally.

@fractalwrench fractalwrench requested a review from a team as a code owner May 21, 2024 14:21
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.92%. Comparing base (c7297cc) to head (21a67a8).
Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #876   +/-   ##
=======================================
  Coverage   80.91%   80.92%           
=======================================
  Files         434      434           
  Lines       11502    11502           
  Branches     1753     1753           
=======================================
+ Hits         9307     9308    +1     
+ Misses       1427     1422    -5     
- Partials      768      772    +4     
Files Coverage Δ
...ndroid/embracesdk/anr/sigquit/SigquitDataSource.kt 36.66% <100.00%> (ø)
...droid/embracesdk/arch/datasource/DataSourceImpl.kt 94.73% <100.00%> (+0.29%) ⬆️
...ndroid/embracesdk/arch/limits/UpToLimitStrategy.kt 100.00% <ø> (ø)
...ndroid/embracesdk/capture/aei/AeiDataSourceImpl.kt 85.36% <100.00%> (ø)
...dk/capture/connectivity/NetworkStatusDataSource.kt 96.15% <100.00%> (ø)
.../embracesdk/capture/crumbs/BreadcrumbDataSource.kt 92.85% <100.00%> (ø)
...cesdk/capture/crumbs/PushNotificationDataSource.kt 87.09% <100.00%> (ø)
...id/embracesdk/capture/crumbs/RnActionDataSource.kt 85.00% <100.00%> (ø)
...android/embracesdk/capture/crumbs/TapDataSource.kt 70.83% <100.00%> (ø)
...ndroid/embracesdk/capture/crumbs/ViewDataSource.kt 81.25% <100.00%> (ø)
... and 5 more

... and 4 files with indirect coverage changes

@@ -37,7 +37,10 @@ internal abstract class DataSourceImpl<T>(
): Boolean {
try {
if (enforceLimits && !limitStrategy.shouldCapture()) {
logger.logWarning("Data capture limit reached.")
logger.logInfo(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to output this multiple times or just once per session?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO let's do it multiple times for now, then following feedback from customers change to once per session if it's too spammy. I'm hoping that setting the log level & increasing descriptiveness of message will be enough of a change

Copy link
Collaborator

@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. One comment about whether we want to keep logging this once we've done it once for a particular data source, but not a blocking comment

@fractalwrench fractalwrench merged commit 8434518 into master May 21, 2024
4 checks passed
@fractalwrench fractalwrench deleted the tweak-data-source-warning branch May 21, 2024 18:30
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.

2 participants