-
-
Notifications
You must be signed in to change notification settings - Fork 372
Limit log batching to maximum 100 logs per batch #6768
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
Conversation
…sentry-cocoa into fix/introduce-log-count-limit
|
@philipphofmann @noahsmartin I'm thinking if we should also drop individual log item > 1MB or prune large attributes. WDYT? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6768 +/- ##
=============================================
- Coverage 84.896% 84.884% -0.013%
=============================================
Files 453 453
Lines 27597 27600 +3
Branches 12101 12104 +3
=============================================
- Hits 23429 23428 -1
- Misses 4123 4127 +4
Partials 45 45
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
Let's please cap this at 100, as in https://develop.sentry.dev/sdk/telemetry/logs/#buffering. |
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4bf98bf | 1219.13 ms | 1244.50 ms | 25.38 ms |
| 5cbd333 | 1220.78 ms | 1234.15 ms | 13.36 ms |
| c174e5e | 1209.65 ms | 1238.73 ms | 29.08 ms |
| 5aa3ce5 | 1222.78 ms | 1245.39 ms | 22.61 ms |
| be882e4 | 1199.35 ms | 1231.20 ms | 31.86 ms |
| 86eb6d5 | 1224.95 ms | 1251.82 ms | 26.87 ms |
| 9c75c11 | 1228.42 ms | 1262.81 ms | 34.39 ms |
| d0f70ce | 1226.54 ms | 1247.04 ms | 20.50 ms |
| 9ccc0f5 | 1227.59 ms | 1264.07 ms | 36.47 ms |
| e36128b | 1213.04 ms | 1248.60 ms | 35.56 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4bf98bf | 23.75 KiB | 919.70 KiB | 895.95 KiB |
| 5cbd333 | 23.74 KiB | 969.66 KiB | 945.92 KiB |
| c174e5e | 23.75 KiB | 953.92 KiB | 930.16 KiB |
| 5aa3ce5 | 23.75 KiB | 904.54 KiB | 880.79 KiB |
| be882e4 | 23.75 KiB | 946.69 KiB | 922.94 KiB |
| 86eb6d5 | 23.74 KiB | 1.02 MiB | 1016.53 KiB |
| 9c75c11 | 23.74 KiB | 1022.95 KiB | 999.20 KiB |
| d0f70ce | 23.75 KiB | 913.09 KiB | 889.34 KiB |
| 9ccc0f5 | 24.14 KiB | 1.01 MiB | 1014.11 KiB |
| e36128b | 23.75 KiB | 963.19 KiB | 939.44 KiB |
philipphofmann
left a comment
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.
Thanks
I also added this as recommendation to getsentry/sentry-docs#15513 |
📜 Description
This took some digging. I was testing sending logs in a tight loop and got rejected by the backend.
So I checked replay code. The issue is that it has 1000 logs MAX item limit,
which is not in any documentation we used when implementing the log batching.Its documented here (https://develop.sentry.dev/sdk/telemetry/logs/#buffering)Another issue I saw during testing is that envelopes persisted with > 1000 log items are being re-tried, so this is something that clients out there may be experiencing.
💡 Motivation and Context
Log envelopes dropped by the backend.
💚 How did you test it?
Unit tests. Sample app.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.Closes #6770