Skip to content

Commit 367d8b9

Browse files
authored
Log a warning when envelope or items are dropped due to rate limiting (#4148)
* Log a warning when items or whole envelope are dropped due to rate limiting * changelog
1 parent c2c78de commit 367d8b9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
### Fixes
1818

19+
- Log a warning when envelope or items are dropped due to rate limiting ([#4148](https://github.com/getsentry/sentry-java/pull/4148))
1920
- Do not log if `OtelContextScopesStorage` cannot be found ([#4127](https://github.com/getsentry/sentry-java/pull/4127))
2021
- Previously `java.lang.ClassNotFoundException: io.sentry.opentelemetry.OtelContextScopesStorage` was shown in the log if the class could not be found.
2122
- This is just a lookup the SDK performs to configure itself. The SDK also works without OpenTelemetry.

sentry/src/main/java/io/sentry/transport/RateLimiter.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ public RateLimiter(final @NotNull SentryOptions options) {
7575
if (dropItems != null) {
7676
options
7777
.getLogger()
78-
.log(SentryLevel.INFO, "%d items will be dropped due rate limiting.", dropItems.size());
78+
.log(
79+
SentryLevel.WARNING,
80+
"%d envelope items will be dropped due rate limiting.",
81+
dropItems.size());
7982

8083
// Need a new envelope
8184
List<SentryEnvelopeItem> toSend = new ArrayList<>();
@@ -87,7 +90,9 @@ public RateLimiter(final @NotNull SentryOptions options) {
8790

8891
// no reason to continue
8992
if (toSend.isEmpty()) {
90-
options.getLogger().log(SentryLevel.INFO, "Envelope discarded due all items rate limited.");
93+
options
94+
.getLogger()
95+
.log(SentryLevel.WARNING, "Envelope discarded due all items rate limited.");
9196

9297
markHintWhenSendingFailed(hint, false);
9398
return null;

0 commit comments

Comments
 (0)