Skip to content

Commit ea14ff7

Browse files
authored
fix some spammy logging (#164)
1 parent 1408e59 commit ea14ff7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/arpnetworking/tsdcore/sinks/HttpSinkActor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public Receive createReceive() {
187187
final int attempt = rejected.getAttempt();
188188
final Response response = rejected.getResponse();
189189
if (_retryableStatusCodes.contains(response.getStatusCode()) && attempt < _sink.getMaximumAttempts()) {
190-
LOGGER.warn()
190+
POST_RETRY_LOGGER.warn()
191191
.setMessage("Attempt rejected")
192192
.addData("sink", _sink)
193193
.addData("status", response.getStatusCode())
@@ -206,7 +206,7 @@ public Receive createReceive() {
206206
.match(PostFailure.class, failure -> {
207207
final int attempt = failure.getAttempt();
208208
if (attempt < _sink.getMaximumAttempts()) {
209-
LOGGER.warn()
209+
POST_RETRY_LOGGER.warn()
210210
.setMessage("Attempt failed")
211211
.addData("sink", _sink)
212212
.addData("error", failure.getCause())
@@ -262,7 +262,7 @@ private void processRejectedRequest(final PostRejected rejected) {
262262
responseStatusClass == i ? 1 : 0);
263263
}
264264

265-
LOGGER.warn()
265+
POST_ERROR_LOGGER.warn()
266266
.setMessage("Post rejected")
267267
.addData("sink", _sink)
268268
.addData("status", responseStatusCode)
@@ -449,6 +449,7 @@ private void scheduleRetry(final RequestEntry requestEntry, final int attempt) {
449449
private final String _samplesDroppedName;
450450

451451
private static final Logger LOGGER = LoggerFactory.getLogger(HttpSinkActor.class);
452+
private static final Logger POST_RETRY_LOGGER = LoggerFactory.getRateLimitLogger(HttpSinkActor.class, Duration.ofSeconds(30));
452453
private static final Logger POST_ERROR_LOGGER = LoggerFactory.getRateLimitLogger(HttpSinkActor.class, Duration.ofSeconds(30));
453454
private static final Logger EVICTED_LOGGER = LoggerFactory.getRateLimitLogger(HttpSinkActor.class, Duration.ofSeconds(30));
454455
private static final ImmutableList<Integer> STATUS_CLASSES = com.google.common.collect.ImmutableList.of(2, 3, 4, 5);

0 commit comments

Comments
 (0)