From 452f0ec7fad5720e1c3d33de4940f2e5c1f5949e Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Fri, 12 Sep 2025 15:59:21 -0400 Subject: [PATCH] HdrReservoir: add hint to record error on how to fix it When HdrHistogram writes latency if latency is higher than maximum expected it throws error. Driver catches this error and logs it. Users get confused since there is no reciepe how to fix it. Solution is to set advanced.metrics.session.cql-requests.highest-latency to maximum possible latency, which is request timeout. But since request timeout could be configured on the execution profile, we can't automatically tune highest-latency to match it. So, only good solution is to give user a hint in the log message. --- .../oss/driver/internal/core/metrics/HdrReservoir.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/metrics/HdrReservoir.java b/core/src/main/java/com/datastax/oss/driver/internal/core/metrics/HdrReservoir.java index c66fe1dbf8a..7645fd88f50 100644 --- a/core/src/main/java/com/datastax/oss/driver/internal/core/metrics/HdrReservoir.java +++ b/core/src/main/java/com/datastax/oss/driver/internal/core/metrics/HdrReservoir.java @@ -90,7 +90,10 @@ public void update(long value) { try { recorder.recordValue(value / 1000); } catch (ArrayIndexOutOfBoundsException e) { - LOG.warn("[{}] Recorded value ({}) is out of bounds, discarding", logPrefix, value); + LOG.warn( + "[{}] Recorded value ({}) is out of bounds, discarding. Set advanced.metrics.session.cql-requests.highest-latency to maximum possible request timeout to make it not happening.", + logPrefix, + value); } }