mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 07:28:06 +01:00
Don't report exceptions as part of traffic metrics.
This commit is contained in:
committed by
Jon Chambers
parent
4188cc2949
commit
08dd493f98
@@ -18,12 +18,10 @@ import java.util.List;
|
||||
*/
|
||||
class MetricsRequestEventListener implements RequestEventListener {
|
||||
|
||||
static final String COUNTER_NAME = MetricRegistry.name(MetricsRequestEventListener.class, "request");
|
||||
|
||||
static final String PATH_TAG = "path";
|
||||
static final String STATUS_CODE_TAG = "status";
|
||||
static final String TRAFFIC_SOURCE_TAG = "trafficSource";
|
||||
static final String EXCEPTION_TAG = "exception";
|
||||
static final String COUNTER_NAME = MetricRegistry.name(MetricsRequestEventListener.class, "request");
|
||||
static final String PATH_TAG = "path";
|
||||
static final String STATUS_CODE_TAG = "status";
|
||||
static final String TRAFFIC_SOURCE_TAG = "trafficSource";
|
||||
|
||||
private final TrafficSource trafficSource;
|
||||
private final MeterRegistry meterRegistry;
|
||||
@@ -50,14 +48,6 @@ class MetricsRequestEventListener implements RequestEventListener {
|
||||
final List<String> userAgentValues = event.getContainerRequest().getRequestHeader("User-Agent");
|
||||
tags.addAll(UserAgentTagUtil.getUserAgentTags(userAgentValues != null ? userAgentValues.stream().findFirst().orElse(null) : null));
|
||||
|
||||
if (event.getException() != null) {
|
||||
if (event.getException() instanceof MappableException) {
|
||||
tags.add(Tag.of(EXCEPTION_TAG, event.getException().getCause().getClass().getSimpleName()));
|
||||
} else {
|
||||
tags.add(Tag.of(EXCEPTION_TAG, event.getException().getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
meterRegistry.counter(COUNTER_NAME, tags).increment();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user