Skip to content

Comments

feat(tp): add rate limiting checks#996

Merged
solnic merged 5 commits intomasterfrom
solnic/better-rate-limit-handling-in-tp
Feb 23, 2026
Merged

feat(tp): add rate limiting checks#996
solnic merged 5 commits intomasterfrom
solnic/better-rate-limit-handling-in-tp

Conversation

@solnic
Copy link
Collaborator

@solnic solnic commented Feb 20, 2026

This addresses suggestions from #987 (review) specifically:

You could already drop rate-limited items before adding them to the buffer. And you could drop rate-limited items in the scheduler before you pass them down to the transport


#skip-changelog

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 6c14e1c

@solnic solnic force-pushed the solnic/better-rate-limit-handling-in-tp branch 3 times, most recently from dc313f3 to a015008 Compare February 20, 2026 15:14
@solnic solnic changed the title feat: add rate limiting checks for log and error events in scheduler feat: add rate limiting checks in TP scheduler Feb 20, 2026
@solnic solnic changed the title feat: add rate limiting checks in TP scheduler feat: add rate limiting checks in TP scheduler & buffer Feb 20, 2026
@solnic solnic force-pushed the solnic/better-rate-limit-handling-in-tp branch 2 times, most recently from 7c1c385 to d951044 Compare February 23, 2026 10:21
@solnic solnic force-pushed the solnic/better-rate-limit-handling-in-tp branch from d951044 to 71de725 Compare February 23, 2026 10:21
@solnic solnic changed the title feat: add rate limiting checks in TP scheduler & buffer feat(tp): add rate limiting checks Feb 23, 2026
@solnic solnic force-pushed the solnic/better-rate-limit-handling-in-tp branch from 71de725 to 6f945b3 Compare February 23, 2026 10:22
That's just cleaner than having side-effects in TP
@solnic solnic marked this pull request as ready for review February 23, 2026 10:43
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@solnic solnic merged commit 16ad8f6 into master Feb 23, 2026
14 checks passed
@solnic solnic deleted the solnic/better-rate-limit-handling-in-tp branch February 23, 2026 12:49
Comment on lines +227 to +231
# When rate-limited, skip the category without polling the buffer. Items remain
# in the buffer and will be sent once the rate limit expires. No client report is
# recorded here because items are not discarded — they are retained for later retry.
# Note: if the buffer overflows while items are held back, the overflow will be
# reported as :cache_overflow rather than :ratelimit_backoff.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I'm sorry. I think this might not have been 100% clear.

Before adding an item to a specific buffer, the telemetry buffer SHOULD drop rate-limited items to avoid overhead. If doing so, it MUST record client reports.
Telemetry Processor

If a rate limit is active, we recommend SDKs to all the rate limited data, see

Events, transactions, sessions, and/or any other supported payload type, depending on the communicated limits, are to be discarded during the period that the rate limit is in place.
Rate Limiting

Do you think I should change the develop docs accordingly so this is clearer, or do you think it is clear enough?

I could add an extra sentence that clearly specifies: when the buffer applies rate limits, it must drop them and not wait to send. I could also update the develop docs on rate limiting to more clearly point this out. Would that help?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philipphofmann thanks for clarification! should we be sending client reports or just completely ignore dropped items as if nothing ever happened? 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants