Skip to content

Commit

Permalink
ERROR vs WARN for registry/publisher errors
Browse files Browse the repository at this point in the history
This should help expose Atlas reporting errors more quickly to systems that harvest and expose ERRORs
  • Loading branch information
Vache Shirikian committed Jan 25, 2024
1 parent cf0b717 commit 33fe0e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void stop() {
overridableClock.setWallTime(now / stepMillis * stepMillis + stepMillis);
sendToAtlas();
} catch (Exception e) {
logger.warn("failed to flush data to Atlas", e);
logger.error("failed to flush data to Atlas", e);
}

// Shutdown publisher used for sending metrics
Expand Down Expand Up @@ -317,7 +317,7 @@ void sendToLWC() {
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
}
} catch (Exception e) {
logger.warn("failed to send metrics for subscriptions (uri={})", evalUri, e);
logger.error("failed to send metrics for subscriptions (uri={})", evalUri, e);
}
} else {
logger.debug("lwc is disabled, skipping subscriptions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public CompletableFuture<Void> publish(PublishPayload payload) {
recordClockSkew((date == null) ? 0L : date.toEpochMilli());
validationHelper.recordResults(payload.getMetrics().size(), res);
} catch (Exception e) {
logger.warn("failed to send metrics (uri={})", uri, e);
logger.error("failed to send metrics (uri={})", uri, e);
validationHelper.incrementDroppedHttp(payload.getMetrics().size());
}
};
Expand All @@ -191,7 +191,7 @@ public CompletableFuture<Void> publish(EvalPayload payload) {
.withJsonContent(json)
.send();
} catch (Exception e) {
logger.warn("failed to send metrics for subscriptions (uri={})", evalUri, e);
logger.error("failed to send metrics for subscriptions (uri={})", evalUri, e);
}
};
return CompletableFuture.runAsync(task, senderPool);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ private void collectData() {
.compress(Deflater.BEST_SPEED)
.send();
if (res.status() != 200) {
logger.warn("failed to send metrics, status {}: {}", res.status(), res.entityAsString());
logger.error("failed to send metrics, status {}: {}", res.status(), res.entityAsString());
}
}
removeExpiredMeters();
} catch (Exception e) {
logger.warn("failed to send metrics", e);
logger.error("failed to send metrics", e);
}
}

Expand Down

0 comments on commit 33fe0e1

Please sign in to comment.