Remove Lettuce command latency recorder
This commit is contained in:
parent
d7ad8dd448
commit
e1fcd3e3f6
|
@ -27,8 +27,6 @@ import io.dropwizard.auth.basic.BasicCredentialAuthFilter;
|
||||||
import io.dropwizard.auth.basic.BasicCredentials;
|
import io.dropwizard.auth.basic.BasicCredentials;
|
||||||
import io.dropwizard.setup.Bootstrap;
|
import io.dropwizard.setup.Bootstrap;
|
||||||
import io.dropwizard.setup.Environment;
|
import io.dropwizard.setup.Environment;
|
||||||
import io.lettuce.core.metrics.MicrometerCommandLatencyRecorder;
|
|
||||||
import io.lettuce.core.metrics.MicrometerOptions;
|
|
||||||
import io.lettuce.core.resource.ClientResources;
|
import io.lettuce.core.resource.ClientResources;
|
||||||
import io.micrometer.core.instrument.Meter.Id;
|
import io.micrometer.core.instrument.Meter.Id;
|
||||||
import io.micrometer.core.instrument.Metrics;
|
import io.micrometer.core.instrument.Metrics;
|
||||||
|
@ -140,7 +138,6 @@ import org.whispersystems.textsecuregcm.metrics.CpuUsageGauge;
|
||||||
import org.whispersystems.textsecuregcm.metrics.FileDescriptorGauge;
|
import org.whispersystems.textsecuregcm.metrics.FileDescriptorGauge;
|
||||||
import org.whispersystems.textsecuregcm.metrics.FreeMemoryGauge;
|
import org.whispersystems.textsecuregcm.metrics.FreeMemoryGauge;
|
||||||
import org.whispersystems.textsecuregcm.metrics.GarbageCollectionGauges;
|
import org.whispersystems.textsecuregcm.metrics.GarbageCollectionGauges;
|
||||||
import org.whispersystems.textsecuregcm.metrics.LettuceMetricsMeterFilter;
|
|
||||||
import org.whispersystems.textsecuregcm.metrics.MaxFileDescriptorGauge;
|
import org.whispersystems.textsecuregcm.metrics.MaxFileDescriptorGauge;
|
||||||
import org.whispersystems.textsecuregcm.metrics.MetricsApplicationEventListener;
|
import org.whispersystems.textsecuregcm.metrics.MetricsApplicationEventListener;
|
||||||
import org.whispersystems.textsecuregcm.metrics.MetricsRequestEventListener;
|
import org.whispersystems.textsecuregcm.metrics.MetricsRequestEventListener;
|
||||||
|
@ -293,7 +290,6 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||||
.meterFilter(MeterFilter.denyNameStartsWith(MetricsRequestEventListener.ANDROID_REQUEST_COUNTER_NAME))
|
.meterFilter(MeterFilter.denyNameStartsWith(MetricsRequestEventListener.ANDROID_REQUEST_COUNTER_NAME))
|
||||||
.meterFilter(MeterFilter.denyNameStartsWith(MetricsRequestEventListener.DESKTOP_REQUEST_COUNTER_NAME))
|
.meterFilter(MeterFilter.denyNameStartsWith(MetricsRequestEventListener.DESKTOP_REQUEST_COUNTER_NAME))
|
||||||
.meterFilter(MeterFilter.denyNameStartsWith(MetricsRequestEventListener.IOS_REQUEST_COUNTER_NAME))
|
.meterFilter(MeterFilter.denyNameStartsWith(MetricsRequestEventListener.IOS_REQUEST_COUNTER_NAME))
|
||||||
.meterFilter(new LettuceMetricsMeterFilter())
|
|
||||||
.meterFilter(new MeterFilter() {
|
.meterFilter(new MeterFilter() {
|
||||||
@Override
|
@Override
|
||||||
public DistributionStatisticConfig configure(final Id id, final DistributionStatisticConfig config) {
|
public DistributionStatisticConfig configure(final Id id, final DistributionStatisticConfig config) {
|
||||||
|
@ -394,9 +390,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||||
config.getPubsubCacheConfiguration().getCircuitBreakerConfiguration());
|
config.getPubsubCacheConfiguration().getCircuitBreakerConfiguration());
|
||||||
ReplicatedJedisPool pubsubClient = pubSubClientFactory.getRedisClientPool();
|
ReplicatedJedisPool pubsubClient = pubSubClientFactory.getRedisClientPool();
|
||||||
|
|
||||||
MicrometerOptions options = MicrometerOptions.builder().build();
|
ClientResources redisClientResources = ClientResources.builder().build();
|
||||||
ClientResources redisClientResources = ClientResources.builder()
|
|
||||||
.commandLatencyRecorder(new MicrometerCommandLatencyRecorder(Metrics.globalRegistry, options)).build();
|
|
||||||
ConnectionEventLogger.logConnectionEvents(redisClientResources);
|
ConnectionEventLogger.logConnectionEvents(redisClientResources);
|
||||||
|
|
||||||
FaultTolerantRedisCluster cacheCluster = new FaultTolerantRedisCluster("main_cache_cluster", config.getCacheClusterConfiguration(), redisClientResources);
|
FaultTolerantRedisCluster cacheCluster = new FaultTolerantRedisCluster("main_cache_cluster", config.getCacheClusterConfiguration(), redisClientResources);
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2022 Signal Messenger, LLC
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.whispersystems.textsecuregcm.metrics;
|
|
||||||
|
|
||||||
import io.micrometer.core.instrument.Meter;
|
|
||||||
import io.micrometer.core.instrument.config.MeterFilter;
|
|
||||||
|
|
||||||
public class LettuceMetricsMeterFilter implements MeterFilter {
|
|
||||||
|
|
||||||
private static final String METRIC_NAME_PREFIX = "lettuce.command";
|
|
||||||
private static final String REMOTE_TAG = "remote";
|
|
||||||
|
|
||||||
// the `remote` tag is very high-cardinality, so we ignore it.
|
|
||||||
// In the future, it would be nice to map a remote (address:port) to a logical cluster name
|
|
||||||
private static final MeterFilter IGNORE_TAGS_FILTER = MeterFilter.ignoreTags(REMOTE_TAG);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Meter.Id map(final Meter.Id id) {
|
|
||||||
|
|
||||||
if (id.getName().startsWith(METRIC_NAME_PREFIX)) {
|
|
||||||
return IGNORE_TAGS_FILTER.map(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue