aboutsummaryrefslogtreecommitdiffstats
path: root/metrics-proxy
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-12-01 16:35:44 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2021-12-01 16:35:44 +0100
commitf3a745446fca01926f5bae570594602b0c09feb6 (patch)
tree6677de52c2ce3b6c042a39d57f4b7687fbba1041 /metrics-proxy
parentc10917672ef65303eb758fbe5a38a69f941523c6 (diff)
Use debug logging for exceptions known to happen during normal operations when reconfiguring system.
Diffstat (limited to 'metrics-proxy')
-rw-r--r--metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java17
1 files changed, 10 insertions, 7 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 2ddbc71268c..80197758104 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,13 +6,13 @@ 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.config.RequestConfig;
import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.util.Timeout;
import java.io.IOException;
+import java.net.SocketException;
import java.time.Clock;
import java.time.Duration;
import java.util.HashMap;
@@ -71,8 +71,8 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
@Override
public void run() {
- try {
- while (true) {
+ while (true) {
+ try {
ConsumerId [] consumers;
synchronized (pollThread) {
consumers = consumerSet.toArray(new ConsumerId[0]);
@@ -92,8 +92,12 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
pollThread.wait(timeUntilNextPoll.toMillis());
if (stopped) return;
}
+ } catch (InterruptedException e) {
+ } catch (Exception e) {
+ log.log(Level.WARNING, "Got unknown exception:", e);
}
- } catch (InterruptedException e) {}
+ }
+
}
@Override
@@ -162,9 +166,8 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
if ((result != null) && result) numOk++;
} catch (InterruptedException | ExecutionException | TimeoutException 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() + "' : " + cause.getMessage());
+ if ( e instanceof ExecutionException && (cause instanceof SocketException)) {
+ log.log(Level.FINE, "Failed retrieving metrics for '" + entry.getKey() + "' : " + cause.getMessage());
} else {
log.log(Level.WARNING, "Failed retrieving metrics for '" + entry.getKey() + "' : ", e);
}