Skip to content
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

ref(transport): Log a warning when dropping envelopes due to rate-limiting #4463

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rwachtler
Copy link

@rwachtler rwachtler commented Oct 21, 2024

📜 Description

  • Raise the level of an existing log statement which indicated that all envelope items were rate-limited, to SENTRY_LOG_WARN.
  • Introduce a new log statement which will log a warning each time an envelope item has been dropped due to an exceeding rate-limit.
  • Update clang-formatter to 19.1.2
    • When trying to commit I've got following error:
      • clang-format version mismatch, expected: 19.1.1, but found: 19.1.2. Please run make init to update your local dev tools. This may actually upgrade to a newer version than what is currently recorded in the lockfile; if that happens, please commit the update to the lockfile as well.
      • Tried to resolve via make init, but then followed This may actually upgrade to a newer version than what is currently recorded in the lockfile; if that happens, please commit the update to the lockfile as well.
    • It looks like pre-commit, python and mobile-dev-inc/tap/maestro got updated as well, but since those weren't crucial for the commit, I didn't stage/commit those changes.

💡 Motivation and Context

💚 How did you test it?

  • Ran SentryHttpTransportTests

See below:

Running all tests in SentryHttpTransportTests
SentryHttpTransportTests

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • 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.
  • 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.

🔮 Next steps

  • Let me know if the new log message is specific/descriptive enough, or feel free to suggest an alternative. Thanks!

#skip-changelog

@@ -232,6 +232,7 @@ - (SentryFlushResult)flush:(NSTimeInterval)timeout
- (void)envelopeItemDropped:(SentryEnvelopeItem *)envelopeItem
withCategory:(SentryDataCategory)dataCategory;
{
SENTRY_LOG_WARN(@"Envelope item dropped due to exceeding rate limit.");
Copy link
Author

Choose a reason for hiding this comment

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

In case a pattern of "RateLimit [error-description]" has to be followed, that would be my alt suggestion: RateLimit is active for current envelope item, dropping...

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.817%. Comparing base (fc350a4) to head (1e206e5).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4463       +/-   ##
=============================================
- Coverage   91.817%   91.817%   -0.001%     
=============================================
  Files          610       610               
  Lines        68193     68227       +34     
  Branches     24478     24489       +11     
=============================================
+ Hits         62613     62644       +31     
- Misses        5487      5490        +3     
  Partials        93        93               
Files with missing lines Coverage Δ
Sources/Sentry/SentryHttpTransport.m 98.069% <100.000%> (+0.007%) ⬆️

... and 15 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc350a4...1e206e5. Read the comment docs.

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Change rate limiting logs to level warning or error
2 participants