diff options
author | Morten Tokle <mortent@verizonmedia.com> | 2020-11-06 16:19:03 +0100 |
---|---|---|
committer | Morten Tokle <mortent@verizonmedia.com> | 2020-11-06 16:19:03 +0100 |
commit | b0dfbc33a0078ac6f34c299f5626f2a4a5f3e77a (patch) | |
tree | 05ab84d183a74fcc99a28eeb177f5a0a2b239f6d | |
parent | 6ccf5fe3aeb651f38e879bd28018658b123e6119 (diff) |
Add exception dimension
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java | 5 |
1 files changed, 4 insertions, 1 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 9d8a5e277b4..323d49e4639 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 @@ -24,6 +24,7 @@ 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; @@ -66,7 +67,9 @@ public class AthenzClientFactoryImpl implements AthenzClientFactory { 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))); + 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); } } |