-
-
Notifications
You must be signed in to change notification settings - Fork 371
Description
Note
The pull request "Limit log batching to maximum 1000 logs per batch" was created by @denrase but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
📜 Description
This took some digging. I was testing sending logs in a tight loop and got rejected by the backend.
[Sentry] [debug] [1763038665.309155] [SentryRequestOperation:36] Request status: 400
[Sentry] [debug] [1763038665.309175] [SentryRequestOperation:42] Request response: {"detail":"envelope exceeded size limits for type 'log' (https://develop.sentry.dev/sdk/envelopes/#size-limits)"}
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:
- I added tests to verify the changes.
- No new PII added or SDK only sends newly added PII if
sendDefaultPIIis enabled. - I updated the docs if needed.
- I updated the wizard if needed.
- Review from the native team if needed.
- No breaking change or entry added to the changelog.
- No breaking change for hybrid SDKs or communicated to hybrid SDKs.