diff options
author | Morten Tokle <morten.tokle@gmail.com> | 2020-11-09 11:31:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 11:31:09 +0100 |
commit | 5c2c8b506e5c6e4ee6efed053cdf10c32473408e (patch) | |
tree | 72445c06d5d3f30b33753c0e910f165822d50908 /controller-server | |
parent | dc50de961734b229cd4bcb0fb6e515d94df82202 (diff) |
Revert "Report metrics on athenz client errors"
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java index 323d49e4639..173729c7472 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java @@ -2,7 +2,6 @@ package com.yahoo.vespa.hosted.controller.athenz.impl; import com.google.inject.Inject; -import com.yahoo.jdisc.Metric; import com.yahoo.vespa.athenz.api.AthenzIdentity; import com.yahoo.vespa.athenz.client.zms.DefaultZmsClient; import com.yahoo.vespa.athenz.client.zms.ZmsClient; @@ -11,32 +10,21 @@ import com.yahoo.vespa.athenz.client.zts.ZtsClient; import com.yahoo.vespa.athenz.identity.ServiceIdentityProvider; import com.yahoo.vespa.hosted.controller.api.integration.athenz.AthenzClientFactory; import com.yahoo.vespa.hosted.controller.athenz.config.AthenzConfig; -import org.apache.http.client.methods.HttpUriRequest; import java.net.URI; -import java.util.HashMap; -import java.util.Map; /** * @author bjorncs */ public class AthenzClientFactoryImpl implements AthenzClientFactory { - private static final String METRIC_NAME = "athenz.request.error"; - private static final String ATHENZ_SERVICE_DIMENSION = "athenzService"; - private static final String EXCEPTION_DIMENSION = "exception"; - private final AthenzConfig config; private final ServiceIdentityProvider identityProvider; - private final Metric metrics; - private final Map<String, Metric.Context> metricContexts; @Inject - public AthenzClientFactoryImpl(ServiceIdentityProvider identityProvider, AthenzConfig config, Metric metrics) { + public AthenzClientFactoryImpl(ServiceIdentityProvider identityProvider, AthenzConfig config) { this.identityProvider = identityProvider; this.config = config; - this.metrics = metrics; - this.metricContexts = new HashMap<>(); } @Override @@ -49,7 +37,7 @@ public class AthenzClientFactoryImpl implements AthenzClientFactory { */ @Override public ZmsClient createZmsClient() { - return new DefaultZmsClient(URI.create(config.zmsUrl()), identityProvider, this::reportMetricErrorHandler); + return new DefaultZmsClient(URI.create(config.zmsUrl()), identityProvider); } /** @@ -57,7 +45,7 @@ public class AthenzClientFactoryImpl implements AthenzClientFactory { */ @Override public ZtsClient createZtsClient() { - return new DefaultZtsClient.Builder(URI.create(config.ztsUrl())).withIdentityProvider(identityProvider).build(); + return new DefaultZtsClient(URI.create(config.ztsUrl()), identityProvider); } @Override @@ -65,11 +53,4 @@ public class AthenzClientFactoryImpl implements AthenzClientFactory { return true; } - private void reportMetricErrorHandler(HttpUriRequest request, Exception error) { - String hostname = request.getURI().getHost(); - Metric.Context context = metricContexts.computeIfAbsent(hostname, host -> metrics.createContext( - Map.of(ATHENZ_SERVICE_DIMENSION, host, - EXCEPTION_DIMENSION, error.getClass().getSimpleName()))); - metrics.add(METRIC_NAME, 1, context); - } } |