From 0ca9e973add535a3f36f5541db4cf7dd9c4f6ed2 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Tue, 12 Nov 2024 12:10:18 -0600 Subject: [PATCH] Add ephemeral tag to MRM error retrieval counter --- .../textsecuregcm/storage/MessagesCache.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java index 83621187d..eee9450ed 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java @@ -137,7 +137,8 @@ public class MessagesCache { private final Counter staleEphemeralMessagesCounter = Metrics.counter( name(MessagesCache.class, "staleEphemeralMessages")); private final Counter mrmContentRetrievedCounter = Metrics.counter(name(MessagesCache.class, "mrmViewRetrieved")); - private final Counter mrmRetrievalErrorCounter = Metrics.counter(name(MessagesCache.class, "mrmRetrievalError")); + private final String MRM_RETRIEVAL_ERROR_COUNTER_NAME = "mrmRetrievalError"; + private final String EPHEMERAL_TAG_NAME = "ephemeral"; private final Counter mrmPhaseTwoMissingContentCounter = Metrics.counter( name(MessagesCache.class, "mrmPhaseTwoMissingContent")); private final Counter skippedStaleEphemeralMrmCounter = Metrics.counter( @@ -436,7 +437,10 @@ private Mono getMessageWithSharedMrmData(final MessagePr }) .onErrorResume(throwable -> { logger.warn("Failed to retrieve shared mrm data", throwable); - mrmRetrievalErrorCounter.increment(); + Metrics.counter(MRM_RETRIEVAL_ERROR_COUNTER_NAME, + EPHEMERAL_TAG_NAME, String.valueOf(mrmMessage.getEphemeral())) + .increment(); + return Mono.empty(); }) .share();