From 1049326a705466509c0fe74975095c5b9578c0ec Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Fri, 30 Jun 2023 17:50:52 -0400 Subject: [PATCH] Turn on Lettuce latency metrics --- .../whispersystems/textsecuregcm/WhisperServerService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index 797fbeb56..0ef099be2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -25,6 +25,8 @@ import io.dropwizard.setup.Environment; import io.grpc.Server; import io.grpc.ServerBuilder; +import io.lettuce.core.metrics.MicrometerCommandLatencyRecorder; +import io.lettuce.core.metrics.MicrometerOptions; import io.lettuce.core.resource.ClientResources; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.binder.grpc.MetricCollectingServerInterceptor; @@ -347,7 +349,10 @@ public void run(WhisperServerConfiguration config, Environment environment) thro final VerificationSessions verificationSessions = new VerificationSessions(dynamoDbAsyncClient, config.getDynamoDbTables().getVerificationSessions().getTableName(), clock); - ClientResources redisClientResources = ClientResources.builder().build(); + final ClientResources redisClientResources = ClientResources.builder() + .commandLatencyRecorder(new MicrometerCommandLatencyRecorder(Metrics.globalRegistry, MicrometerOptions.builder().build())) + .build(); + ConnectionEventLogger.logConnectionEvents(redisClientResources); FaultTolerantRedisCluster cacheCluster = new FaultTolerantRedisCluster("main_cache_cluster", config.getCacheClusterConfiguration(), redisClientResources);