From 73d413209189731ff8f778c40c4a46d4484f1f7f Mon Sep 17 00:00:00 2001 From: Miner Date: Wed, 18 Sep 2024 18:27:40 +0000 Subject: [PATCH] Adding support for document size in metrics --- .../querymetric/BaseQueryMetric.java | 10 +++++ .../microservice/querymetric/QueryMetric.java | 25 +++++++---- .../querymetric/QueryMetricModel.java | 4 ++ .../querymetric/QueryMetricModelFormat.java | 2 + .../templates/querymetric-horizontal.html | 1 + service/pom.xml | 2 +- .../MetricUpdateEntryProcessor.java | 1 + .../config/QueryMetricHandlerProperties.java | 2 + .../ContentQueryMetricsIngestHelper.java | 6 +++ .../handler/QueryMetricCombiner.java | 2 + .../handler/ShardTableQueryMetricHandler.java | 41 +++++++++++-------- .../persistence/AccumuloMapStore.java | 22 +++++----- 12 files changed, 84 insertions(+), 34 deletions(-) diff --git a/api/src/main/java/datawave/microservice/querymetric/BaseQueryMetric.java b/api/src/main/java/datawave/microservice/querymetric/BaseQueryMetric.java index 976d1776..b4d0c592 100644 --- a/api/src/main/java/datawave/microservice/querymetric/BaseQueryMetric.java +++ b/api/src/main/java/datawave/microservice/querymetric/BaseQueryMetric.java @@ -673,6 +673,8 @@ public int getFieldNumber(String name) { @XmlJavaTypeAdapter(StringMapAdapter.class) protected Map versionMap = new TreeMap<>(); @XmlElement + protected long docSize = 0; + @XmlElement protected long docRanges = 0; @XmlElement protected long fiRanges = 0; @@ -899,6 +901,14 @@ public void setYieldCount(long yieldCount) { this.yieldCount = yieldCount; } + public long getDocSize() { + return docSize; + } + + public void setDocSize(long docSize) { + this.docSize = docSize; + } + public long getDocRanges() { return docRanges; } diff --git a/api/src/main/java/datawave/microservice/querymetric/QueryMetric.java b/api/src/main/java/datawave/microservice/querymetric/QueryMetric.java index 63cd79b6..2db59b22 100644 --- a/api/src/main/java/datawave/microservice/querymetric/QueryMetric.java +++ b/api/src/main/java/datawave/microservice/querymetric/QueryMetric.java @@ -99,6 +99,7 @@ public QueryMetric(QueryMetric other) { this.seekCount = other.seekCount; this.yieldCount = other.yieldCount; this.versionMap = other.versionMap; + this.docSize = other.docSize; this.docRanges = other.docRanges; this.fiRanges = other.fiRanges; this.plan = other.plan; @@ -140,8 +141,9 @@ public int hashCode() { .append(this.getHost()).append(this.getPageTimes()).append(this.getProxyServers()).append(this.getLifecycle()) .append(this.getErrorMessage()).append(this.getCreateCallTime()).append(this.getErrorCode()).append(this.getQueryName()) .append(this.getParameters()).append(this.getSourceCount()).append(this.getNextCount()).append(this.getSeekCount()) - .append(this.getYieldCount()).append(this.getDocRanges()).append(this.getFiRanges()).append(this.getPlan()).append(this.getLoginTime()) - .append(this.getPredictions()).append(this.getMarkings()).append(this.getNumUpdates()).append(this.getVersionMap()).toHashCode(); + .append(this.getYieldCount()).append(this.getDocSize()).append(this.getDocRanges()).append(this.getFiRanges()).append(this.getPlan()) + .append(this.getLoginTime()).append(this.getPredictions()).append(this.getMarkings()).append(this.getNumUpdates()) + .append(this.getVersionMap()).toHashCode(); } @Override @@ -166,11 +168,11 @@ public boolean equals(Object o) { .append(this.getLifecycle(), other.getLifecycle()).append(this.getErrorMessage(), other.getErrorMessage()) .append(this.getErrorCode(), other.getErrorCode()).append(this.getSourceCount(), other.getSourceCount()) .append(this.getNextCount(), other.getNextCount()).append(this.getSeekCount(), other.getSeekCount()) - .append(this.getYieldCount(), other.getYieldCount()).append(this.getDocRanges(), other.getDocRanges()) - .append(this.getFiRanges(), other.getFiRanges()).append(this.getPlan(), other.getPlan()) - .append(this.getLoginTime(), other.getLoginTime()).append(this.getPredictions(), other.getPredictions()) - .append(this.getMarkings(), other.getMarkings()).append(this.getNumUpdates(), other.getNumUpdates()) - .append(this.getVersionMap(), other.getVersionMap()).isEquals(); + .append(this.getYieldCount(), other.getYieldCount()).append(this.getDocSize(), other.getDocSize()) + .append(this.getDocRanges(), other.getDocRanges()).append(this.getFiRanges(), other.getFiRanges()) + .append(this.getPlan(), other.getPlan()).append(this.getLoginTime(), other.getLoginTime()) + .append(this.getPredictions(), other.getPredictions()).append(this.getMarkings(), other.getMarkings()) + .append(this.getNumUpdates(), other.getNumUpdates()).append(this.getVersionMap(), other.getVersionMap()).isEquals(); } else { return false; } @@ -208,6 +210,7 @@ public String toString() { buf.append(" NextCount: ").append(this.getNextCount()); buf.append(" Seek Count: ").append(this.getSeekCount()); buf.append(" Yield Count: ").append(this.getYieldCount()); + buf.append(" Doc Size: ").append(this.getDocSize()); buf.append(" Doc Ranges: ").append(this.getDocRanges()); buf.append(" FI Ranges: ").append(this.getFiRanges()); buf.append(" Login Time: ").append(this.getLoginTime()); @@ -403,6 +406,8 @@ public void writeTo(Output output, QueryMetric message) throws IOException { output.writeString(38, StringUtils.join(Arrays.asList(entry.getKey(), entry.getValue()), "\0"), true); } } + + output.writeInt64(39, message.docSize, false); } public void mergeFrom(Input input, QueryMetric message) throws IOException { @@ -551,6 +556,9 @@ public void mergeFrom(Input input, QueryMetric message) throws IOException { message.versionMap.put(split[0], split[1]); } break; + case 39: + message.docSize = input.readInt64(); + break; default: input.handleUnknownField(number, this); break; @@ -637,6 +645,8 @@ public String getFieldName(int number) { return "version"; case 38: return "versionMap"; + case 39: + return "docSize"; default: return null; } @@ -688,6 +698,7 @@ public int getFieldNumber(String name) { fieldMap.put("predictions", 36); fieldMap.put("version", 37); fieldMap.put("versionMap", 38); + fieldMap.put("docSize", 39); } }; diff --git a/api/src/main/java/datawave/microservice/querymetric/QueryMetricModel.java b/api/src/main/java/datawave/microservice/querymetric/QueryMetricModel.java index 9248ea95..39a72b29 100644 --- a/api/src/main/java/datawave/microservice/querymetric/QueryMetricModel.java +++ b/api/src/main/java/datawave/microservice/querymetric/QueryMetricModel.java @@ -121,6 +121,10 @@ public String getNumResultsStr() { return nf.format(numResults); } + public String getDocSizeStr() { + return nf.format(docSize); + } + public String getDocRangesStr() { return nf.format(docRanges); } diff --git a/api/src/main/java/datawave/microservice/querymetric/QueryMetricModelFormat.java b/api/src/main/java/datawave/microservice/querymetric/QueryMetricModelFormat.java index 0d95ee76..bbbfa288 100644 --- a/api/src/main/java/datawave/microservice/querymetric/QueryMetricModelFormat.java +++ b/api/src/main/java/datawave/microservice/querymetric/QueryMetricModelFormat.java @@ -46,6 +46,8 @@ public interface QueryMetricModelFormat { String getNumResultsStr(); + String getDocSizeStr(); + String getDocRangesStr(); String getFiRangesStr(); diff --git a/api/src/main/resources/templates/querymetric-horizontal.html b/api/src/main/resources/templates/querymetric-horizontal.html index 9d90f8a4..0be94085 100644 --- a/api/src/main/resources/templates/querymetric-horizontal.html +++ b/api/src/main/resources/templates/querymetric-horizontal.html @@ -52,6 +52,7 @@

Query Metrics

Query Setup Call Time (ms) Number Pages Number Results + Doc Size Doc Ranges FI Ranges Sources diff --git a/service/pom.xml b/service/pom.xml index cb9e3b4d..0a09db7a 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -28,7 +28,7 @@ 4.0.0 4.0.0 4.0.2 - 4.0.7 + 4.0.8-SNAPSHOT 4.0.2 3.0.3 3.0.2 diff --git a/service/src/main/java/datawave/microservice/querymetric/MetricUpdateEntryProcessor.java b/service/src/main/java/datawave/microservice/querymetric/MetricUpdateEntryProcessor.java index 08c4cc7b..05f154a2 100644 --- a/service/src/main/java/datawave/microservice/querymetric/MetricUpdateEntryProcessor.java +++ b/service/src/main/java/datawave/microservice/querymetric/MetricUpdateEntryProcessor.java @@ -42,6 +42,7 @@ public Long process(Map.Entry entry) { storedHolder.addValue("nextCount", updatedMetric.getNextCount()); storedHolder.addValue("seekCount", updatedMetric.getSeekCount()); storedHolder.addValue("yieldCount", updatedMetric.getYieldCount()); + storedHolder.addValue("docSize", updatedMetric.getDocSize()); storedHolder.addValue("docRanges", updatedMetric.getDocRanges()); storedHolder.addValue("fiRanges", updatedMetric.getFiRanges()); } diff --git a/service/src/main/java/datawave/microservice/querymetric/config/QueryMetricHandlerProperties.java b/service/src/main/java/datawave/microservice/querymetric/config/QueryMetricHandlerProperties.java index 6c7ca62e..3e4b1e05 100644 --- a/service/src/main/java/datawave/microservice/querymetric/config/QueryMetricHandlerProperties.java +++ b/service/src/main/java/datawave/microservice/querymetric/config/QueryMetricHandlerProperties.java @@ -90,6 +90,7 @@ public class QueryMetricHandlerProperties { "CREATE_CALL_TIME", "CREATE_DATE", "DOC_RANGES", + "DOC_SIZE", "ELAPSED_TIME", "END_DATE", "ERROR_CODE", @@ -141,6 +142,7 @@ public class QueryMetricHandlerProperties { protected List numericFields = Arrays.asList( "CREATE_CALL_TIME", "DOC_RANGES", + "DOC_SIZE", "ELAPSED_TIME", "FI_RANGES", "LOGIN_TIME", diff --git a/service/src/main/java/datawave/microservice/querymetric/handler/ContentQueryMetricsIngestHelper.java b/service/src/main/java/datawave/microservice/querymetric/handler/ContentQueryMetricsIngestHelper.java index 60109803..e5ad36d6 100644 --- a/service/src/main/java/datawave/microservice/querymetric/handler/ContentQueryMetricsIngestHelper.java +++ b/service/src/main/java/datawave/microservice/querymetric/handler/ContentQueryMetricsIngestHelper.java @@ -202,6 +202,9 @@ public Multimap getEventFieldsToWrite(T updated, T stored) { if (isChanged(updated.getDocRanges(), stored == null ? -1 : stored.getDocRanges())) { fields.put("DOC_RANGES", Long.toString(updated.getDocRanges())); } + if (isChanged(updated.getDocSize(), stored == null ? -1 : stored.getDocSize())) { + fields.put("DOC_SIZE", Long.toString(updated.getDocSize())); + } if (isChanged(updated.getElapsedTime(), stored == null ? -1 : stored.getElapsedTime())) { fields.put("ELAPSED_TIME", Long.toString(updated.getElapsedTime())); } @@ -383,6 +386,9 @@ public Multimap getEventFieldsToDelete(T updated, T stored) { if (isChanged(updated.getDocRanges(), stored.getDocRanges())) { fields.put("DOC_RANGES", Long.toString(stored.getDocRanges())); } + if (isChanged(updated.getDocSize(), stored.getDocSize())) { + fields.put("DOC_SIZE", Long.toString(stored.getDocSize())); + } if (isChanged(updated.getElapsedTime(), stored.getElapsedTime())) { fields.put("ELAPSED_TIME", Long.toString(stored.getElapsedTime())); } diff --git a/service/src/main/java/datawave/microservice/querymetric/handler/QueryMetricCombiner.java b/service/src/main/java/datawave/microservice/querymetric/handler/QueryMetricCombiner.java index 14e74caa..d015086a 100644 --- a/service/src/main/java/datawave/microservice/querymetric/handler/QueryMetricCombiner.java +++ b/service/src/main/java/datawave/microservice/querymetric/handler/QueryMetricCombiner.java @@ -184,6 +184,7 @@ public T combineMetrics(T updatedQueryMetric, T cachedQueryMetric, QueryMetricTy combinedMetric.setNextCount(combinedMetric.getNextCount() + updatedQueryMetric.getNextCount()); combinedMetric.setSeekCount(combinedMetric.getSeekCount() + updatedQueryMetric.getSeekCount()); combinedMetric.setYieldCount(combinedMetric.getYieldCount() + updatedQueryMetric.getYieldCount()); + combinedMetric.setDocSize(combinedMetric.getDocSize() + updatedQueryMetric.getDocSize()); combinedMetric.setDocRanges(combinedMetric.getDocRanges() + updatedQueryMetric.getDocRanges()); combinedMetric.setFiRanges(combinedMetric.getFiRanges() + updatedQueryMetric.getFiRanges()); } else { @@ -191,6 +192,7 @@ public T combineMetrics(T updatedQueryMetric, T cachedQueryMetric, QueryMetricTy combinedMetric.setNextCount(updatedQueryMetric.getNextCount()); combinedMetric.setSeekCount(updatedQueryMetric.getSeekCount()); combinedMetric.setYieldCount(updatedQueryMetric.getYieldCount()); + combinedMetric.setDocSize(updatedQueryMetric.getDocSize()); combinedMetric.setDocRanges(updatedQueryMetric.getDocRanges()); combinedMetric.setFiRanges(updatedQueryMetric.getFiRanges()); } diff --git a/service/src/main/java/datawave/microservice/querymetric/handler/ShardTableQueryMetricHandler.java b/service/src/main/java/datawave/microservice/querymetric/handler/ShardTableQueryMetricHandler.java index 6afb6715..e04468d9 100644 --- a/service/src/main/java/datawave/microservice/querymetric/handler/ShardTableQueryMetricHandler.java +++ b/service/src/main/java/datawave/microservice/querymetric/handler/ShardTableQueryMetricHandler.java @@ -552,7 +552,7 @@ public T toMetric(EventBase event) { Date d = sdf_date_time1.parse(fieldValue); m.setBeginDate(d); } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("CREATE_CALL_TIME")) { m.setCreateCallTime(Long.parseLong(fieldValue)); @@ -562,7 +562,7 @@ public T toMetric(EventBase event) { m.setCreateDate(d); createDateSet = true; } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("DOC_RANGES")) { try { @@ -571,14 +571,23 @@ public T toMetric(EventBase event) { m.setDocRanges(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); + } + } else if (fieldName.equals("DOC_SIZE")) { + try { + long l = Long.parseLong(fieldValue); + if (l > m.getDocSize()) { + m.setDocSize(l); + } + } catch (Exception e) { + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("END_DATE")) { try { Date d = sdf_date_time1.parse(fieldValue); m.setEndDate(d); } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("ERROR_CODE")) { m.setErrorCode(fieldValue); @@ -591,7 +600,7 @@ public T toMetric(EventBase event) { m.setFiRanges(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("HOST")) { m.setHost(fieldValue); @@ -603,7 +612,7 @@ public T toMetric(EventBase event) { m.setLastUpdated(d); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("LIFECYCLE")) { Lifecycle l = Lifecycle.valueOf(fieldValue); @@ -627,7 +636,7 @@ public T toMetric(EventBase event) { m.setNextCount(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("NUM_UPDATES")) { try { @@ -636,14 +645,14 @@ public T toMetric(EventBase event) { m.setNumUpdates(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.startsWith("PAGE_METRICS")) { int index = fieldName.indexOf("."); if (-1 == index) { - log.error("Could not parse field name to extract repetition count: " + fieldName); + log.error("Could not parse field name to extract repetition count: {}", fieldName); } else { - Long pageNum = Long.parseLong(fieldName.substring(index + 1)); + long pageNum = Long.parseLong(fieldName.substring(index + 1)); PageMetric pageMetric = PageMetric.parse(fieldValue); if (pageMetric != null) { pageMetric.setPageNumber(pageNum); @@ -673,7 +682,7 @@ public T toMetric(EventBase event) { int x = fieldValue.indexOf(":"); if (x > -1) { String predictionName = fieldValue.substring(0, x); - Double predictionValue = Double.parseDouble(fieldValue.substring(x + 1)); + double predictionValue = Double.parseDouble(fieldValue.substring(x + 1)); m.addPrediction(new Prediction(predictionName, predictionValue)); } } catch (Exception e) { @@ -699,7 +708,7 @@ public T toMetric(EventBase event) { m.setSeekCount(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("SETUP_TIME")) { m.setSetupTime(Long.parseLong(fieldValue)); @@ -710,7 +719,7 @@ public T toMetric(EventBase event) { m.setSourceCount(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } else if (fieldName.equals("USER")) { m.setUser(fieldValue); @@ -727,7 +736,7 @@ public T toMetric(EventBase event) { m.setYieldCount(l); } } catch (Exception e) { - log.error(fieldName + ":" + fieldValue + ":" + e.getMessage()); + log.error("{}:{}:{}", fieldName, fieldValue, e.getMessage()); } } } @@ -773,12 +782,12 @@ protected void createAndConfigureTablesIfNecessary(String[] tableNames, Accumulo if (tableHelper != null) { tableHelper.configure(accumuloClient.tableOperations()); } else { - log.info("No configuration supplied for table: " + table); + log.info("No configuration supplied for table: {}", table); } } } catch (TableExistsException te) { // in this case, somebody else must have created the table after our existence check - log.debug("Tried to create " + table + " but somebody beat us to the punch"); + log.debug("Tried to create {} but somebody beat us to the punch", table); } } } diff --git a/service/src/main/java/datawave/microservice/querymetric/persistence/AccumuloMapStore.java b/service/src/main/java/datawave/microservice/querymetric/persistence/AccumuloMapStore.java index 4433b356..0fbd7e5e 100644 --- a/service/src/main/java/datawave/microservice/querymetric/persistence/AccumuloMapStore.java +++ b/service/src/main/java/datawave/microservice/querymetric/persistence/AccumuloMapStore.java @@ -52,11 +52,11 @@ public class AccumuloMapStore extends AccumuloMapLoad } private static AccumuloMapStore instance; - private Logger log = LoggerFactory.getLogger(AccumuloMapStore.class); + private final Logger log = LoggerFactory.getLogger(AccumuloMapStore.class); private Cache lastWrittenQueryMetricCache; - private com.github.benmanes.caffeine.cache.Cache failures; - private Timer writeTimer = new Timer(new SlidingTimeWindowArrayReservoir(1, MINUTES)); - private Timer readTimer = new Timer(new SlidingTimeWindowArrayReservoir(1, MINUTES)); + private final com.github.benmanes.caffeine.cache.Cache failures; + private final Timer writeTimer = new Timer(new SlidingTimeWindowArrayReservoir(1, MINUTES)); + private final Timer readTimer = new Timer(new SlidingTimeWindowArrayReservoir(1, MINUTES)); private boolean shuttingDown = false; public static class Factory implements MapStoreFactory { @@ -142,7 +142,7 @@ public void store(QueryMetricUpdateHolder queryMetricUpdate) throws Exception // these fields will not be populated in the returned metric, // so we should not compare them later for writing mutations ignoredFields.addAll(ignoreFieldsOnWrite); - lastQueryMetricUpdate = new QueryMetricUpdateHolder(m, metricType); + lastQueryMetricUpdate = new QueryMetricUpdateHolder<>(m, metricType); } } catch (Exception e) { log.error(e.getMessage(), e); @@ -162,6 +162,7 @@ public void store(QueryMetricUpdateHolder queryMetricUpdate) throws Exception updatedMetric.setNextCount(queryMetricUpdate.getValue("nextCount")); updatedMetric.setSeekCount(queryMetricUpdate.getValue("seekCount")); updatedMetric.setYieldCount(queryMetricUpdate.getValue("yieldCount")); + updatedMetric.setDocSize(queryMetricUpdate.getValue("docSize")); updatedMetric.setDocRanges(queryMetricUpdate.getValue("docRanges")); updatedMetric.setFiRanges(queryMetricUpdate.getValue("fiRanges")); } @@ -188,12 +189,12 @@ public void store(QueryMetricUpdateHolder queryMetricUpdate) throws Exception handler.writeMetric(updatedMetric, Collections.emptyList(), updatedMetric.getCreateDate().getTime(), false, ignoredFields); } if (log.isTraceEnabled()) { - log.trace("writing metric to accumulo: " + queryId + " - " + queryMetricUpdate.getMetric()); + log.trace("writing metric to accumulo: {} - {}", queryId, queryMetricUpdate.getMetric()); } else { - log.debug("writing metric to accumulo: " + queryId); + log.debug("writing metric to accumulo: {}", queryId); } - lastWrittenQueryMetricCache.put(queryId, new QueryMetricUpdateHolder(updatedMetric)); + lastWrittenQueryMetricCache.put(queryId, new QueryMetricUpdateHolder<>(updatedMetric)); queryMetricUpdate.setPersisted(); failures.invalidate(queryId); } finally { @@ -205,6 +206,7 @@ public void store(QueryMetricUpdateHolder queryMetricUpdate) throws Exception queryMetricUpdate.getMetric().setNextCount(updatedMetric.getNextCount()); queryMetricUpdate.getMetric().setSeekCount(updatedMetric.getSeekCount()); queryMetricUpdate.getMetric().setYieldCount(updatedMetric.getYieldCount()); + queryMetricUpdate.getMetric().setDocSize(updatedMetric.getDocSize()); queryMetricUpdate.getMetric().setDocRanges(updatedMetric.getDocRanges()); queryMetricUpdate.getMetric().setFiRanges(updatedMetric.getFiRanges()); } @@ -214,7 +216,7 @@ public void store(QueryMetricUpdateHolder queryMetricUpdate) throws Exception private boolean retryOnException(QueryMetricUpdate update, Exception e) { String queryId = update.getMetric().getQueryId(); - Integer numFailures = 1; + int numFailures = 1; try { numFailures = (Integer) this.failures.get(queryId, o -> 0) + 1; } catch (Exception e1) { @@ -227,7 +229,7 @@ private boolean retryOnException(QueryMetricUpdate update, Exception e) { return true; } else { // stop trying by not propagating the exception - log.error("writing metric to accumulo: " + queryId + " failed 3 times, will stop trying: " + update.getMetric(), e); + log.error("writing metric to accumulo: {} failed 3 times, will stop trying: {}", queryId, update.getMetric(), e); this.failures.invalidate(queryId); return false; }