diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-09-17 16:17:28 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-09-17 16:17:28 +0200 |
commit | 62e9ee58a80ba62d1ef25e931b32ffcd2b7e907e (patch) | |
tree | dd03e5a5bf8c1d03cb6acacccafb817a4d7333b4 /metrics-proxy | |
parent | 539e0f42d0484f11c8dfc17e5788c283b6035aed (diff) |
We do not need the stack trace for expected warnings.
Diffstat (limited to 'metrics-proxy')
-rw-r--r-- | metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java index c0f22e38e11..6fbd92cfb2c 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java @@ -6,6 +6,7 @@ import ai.vespa.metricsproxy.metric.model.MetricsPacket; import ai.vespa.util.http.hc5.VespaAsyncHttpClientBuilder; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; +import org.apache.hc.client5.http.HttpHostConnectException; import org.apache.hc.client5.http.async.methods.SimpleHttpResponse; import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; @@ -161,8 +162,13 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru Boolean result = entry.getValue().get(taskTimeout.toMillis(), TimeUnit.MILLISECONDS); if ((result != null) && result) numOk++; } catch (InterruptedException | ExecutionException | TimeoutException e) { - // Since the task is a ForkJoinTask, we don't need special handling of InterruptedException - log.log(Level.WARNING, "Failed retrieving metrics for '" + entry.getKey() + "' : ", e); + Throwable cause = e.getCause(); + if ( e instanceof ExecutionException && (cause != null) && (cause instanceof HttpHostConnectException)) { + // Remove once we have some track time. + log.log(Level.WARNING, "Failed retrieving metrics for '" + entry.getKey() + "' : ", e.getMessage()); + } else { + log.log(Level.WARNING, "Failed retrieving metrics for '" + entry.getKey() + "' : ", e); + } } } log.log(Level.FINE, () -> "Finished retrieving metrics from " + clients.size() + " nodes."); |