Skip to content

Limit log batching to maximum 100 logs per batch #6770

@github-actions

Description

@github-actions

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 sendDefaultPII is 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions