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

Merged

Conversation

rwachtler
Copy link
Contributor

@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 (will be addressed in a separate PR)
    • 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!

Log a warning if all items of the current envelope were rate-limited

Fixes getsentry#4456
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.810%. Comparing base (fc350a4) to head (6c3e79b).
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4463       +/-   ##
=============================================
- Coverage   91.817%   91.810%   -0.008%     
=============================================
  Files          610       610               
  Lines        68193     68231       +38     
  Branches     24478     24497       +19     
=============================================
+ Hits         62613     62643       +30     
- Misses        5487      5496        +9     
+ Partials        93        92        -1     
Files with missing lines Coverage Δ
Sources/Sentry/SentryHttpTransport.m 98.069% <100.000%> (+0.007%) ⬆️

... and 9 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...6c3e79b. 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

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks, the warning log message will be lost in all the noise, but we will fix that here #4467.

Brewfile.lock.json Outdated Show resolved Hide resolved
Sources/Sentry/SentryHttpTransport.m Outdated Show resolved Hide resolved
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

This PR deserves an entry into the Changelog. I think it's an improvement. So add an ##Unreleased entry with a ### Improvements section to the changelog and mention this PR.

@rwachtler
Copy link
Contributor Author

rwachtler commented Oct 23, 2024

This PR deserves an entry into the Changelog. I think it's an improvement. So add an ##Unreleased entry with a ### Improvements section to the changelog and mention this PR.

@philipphofmann Done, I've also removed the #skip-changelog from the description.

A general question from my side - not every single commit on a branch has to follow the rules defined here, right? So as long as let's say the commit message of the final "Squash & Merge" does follow the rules, I'm good?

@brustolin
Copy link
Contributor

A general question from my side - not every single commit on a branch has to follow the rules defined here, right? So as long as let's say the commit message of the final "Squash & Merge" does follow the rules, I'm good?

Yes, only the "Squash & merge" message needs to follow the rules.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM

@philipphofmann philipphofmann merged commit 91ad2c7 into getsentry:main Oct 24, 2024
56 of 63 checks passed
@rwachtler rwachtler deleted the ref/raise-rate-limit-log-level branch October 24, 2024 17:21
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
3 participants