-
-
Notifications
You must be signed in to change notification settings - Fork 465
Report number of discarded log bytes in client report #4868
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
Report number of discarded log bytes in client report #4868
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Report number of discarded log bytes in client report ([#4868](https://github.com/getsentry/sentry-java/pull/4868))If none of the above apply, you can opt out of this check by adding |
| final long count = logs.getItems().size(); | ||
| recordLostEventInternal(reason.getReason(), itemCategory.getCategory(), count); | ||
| executeOnDiscard(reason, itemCategory, count); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Inconsistent Lost-Event Handling for LogItem Envelopes
When a LogItem envelope item is lost but envelopeItem.getLogs() returns null (e.g., due to deserialization failure), no lost event is recorded. This is inconsistent with the Transaction handling (lines 91-103) which always records the transaction as lost even when getTransaction() returns null. The LogItem case should record at least 1 lost item when logs is null, similar to how other item types are handled in the else block (lines 111-113).
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 2124a46 | 319.19 ms | 415.04 ms | 95.85 ms |
| b3d8889 | 420.46 ms | 453.71 ms | 33.26 ms |
| d217708 | 409.83 ms | 474.72 ms | 64.89 ms |
| 3d205d0 | 352.15 ms | 432.53 ms | 80.38 ms |
| fcec2f2 | 357.47 ms | 447.32 ms | 89.85 ms |
| 889ecea | 367.58 ms | 437.52 ms | 69.94 ms |
| 1df7eb6 | 397.04 ms | 429.64 ms | 32.60 ms |
| ce0a49e | 532.00 ms | 609.96 ms | 77.96 ms |
| ee747ae | 357.79 ms | 421.84 ms | 64.05 ms |
| b750b96 | 408.98 ms | 480.32 ms | 71.34 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 2124a46 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| b3d8889 | 1.58 MiB | 2.10 MiB | 535.07 KiB |
| d217708 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| 3d205d0 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| fcec2f2 | 1.58 MiB | 2.12 MiB | 551.50 KiB |
| 889ecea | 1.58 MiB | 2.11 MiB | 539.75 KiB |
| 1df7eb6 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| ce0a49e | 1.58 MiB | 2.10 MiB | 532.94 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| b750b96 | 1.58 MiB | 2.10 MiB | 533.19 KiB |
|
GH didn't like me changing the base, gonna close and reopen. |
📜 Description
When discarding logs we now report the number of bytes discarded in Client Reports.
💡 Motivation and Context
Since discarded log count is not shown in UI, we want to track discarded bytes too.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps