Skip to content

Commit 349c8e9

Browse files
authored
Report discarded log in batch processor as log_byte (#4971)
* Report discarded log in batch processor as log_byte * changelog * fix test to expect log_byte
1 parent abf451a commit 349c8e9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- **IMPORTANT:** This disables collecting external storage size (total/free) by default, to enable it back
99
use `options.isCollectExternalStorageContext = true` or `<meta-data android:name="io.sentry.external-storage-context" android:value="true" />`
1010
- Fix `NullPointerException` when reading ANR marker ([#4979](https://github.com/getsentry/sentry-java/pull/4979))
11+
- Report discarded log in batch processor as `log_byte` ([#4971](https://github.com/getsentry/sentry-java/pull/4971))
1112

1213
### Improvements
1314

sentry/src/main/java/io/sentry/logger/LoggerBatchProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void add(final @NotNull SentryLogEvent logEvent) {
5959
JsonSerializationUtils.byteSizeOf(options.getSerializer(), options.getLogger(), logEvent);
6060
options
6161
.getClientReportRecorder()
62-
.recordLostEvent(DiscardReason.QUEUE_OVERFLOW, DataCategory.Attachment, lostBytes);
62+
.recordLostEvent(DiscardReason.QUEUE_OVERFLOW, DataCategory.LogByte, lostBytes);
6363
return;
6464
}
6565
pendingCount.increment();

sentry/src/test/java/io/sentry/logger/LoggerBatchProcessorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class LoggerBatchProcessorTest {
9191
DiscardedEvent(DiscardReason.QUEUE_OVERFLOW.reason, DataCategory.LogItem.category, 1),
9292
DiscardedEvent(
9393
DiscardReason.QUEUE_OVERFLOW.reason,
94-
DataCategory.Attachment.category,
94+
DataCategory.LogByte.category,
9595
expectedBytes,
9696
),
9797
)

0 commit comments

Comments
 (0)