From 3980dec1230c7beb7f7b5f88facf1c236d71c620 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Wed, 29 Nov 2023 11:08:56 -0500 Subject: [PATCH] Revert "Add metrics to check presence of PNI-associated registration IDs" This reverts commit 1da3f96d106bc7615c4222437f4cb01c21bf24a3. --- .../textsecuregcm/controllers/AccountController.java | 7 ------- .../textsecuregcm/controllers/DeviceController.java | 9 --------- .../textsecuregcm/storage/AccountsManager.java | 4 +--- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java index 76befc158..dde159280 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java @@ -59,7 +59,6 @@ import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier; import org.whispersystems.textsecuregcm.identity.ServiceIdentifier; import org.whispersystems.textsecuregcm.limits.RateLimitedByIp; import org.whispersystems.textsecuregcm.limits.RateLimiters; -import org.whispersystems.textsecuregcm.metrics.MetricsUtil; import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; @@ -87,8 +86,6 @@ public class AccountController { private final RegistrationRecoveryPasswordsManager registrationRecoveryPasswordsManager; private final UsernameHashZkProofVerifier usernameHashZkProofVerifier; - private static final String SET_ATTRIBUTES_COUNTER_NAME = MetricsUtil.name(AccountController.class, "setAttributes"); - public AccountController( AccountsManager accounts, RateLimiters rateLimiters, @@ -247,10 +244,6 @@ public class AccountController { // if registration recovery password was sent to us, store it (or refresh its expiration) attributes.recoveryPassword().ifPresent(registrationRecoveryPassword -> registrationRecoveryPasswordsManager.storeForCurrentNumber(updatedAccount.getNumber(), registrationRecoveryPassword)); - - Metrics.counter(SET_ATTRIBUTES_COUNTER_NAME, - "pniRegistrationIdPresent", String.valueOf(attributes.getPhoneNumberIdentityRegistrationId().isPresent())) - .increment(); } @GET diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java index 29f366b24..5cdab7484 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java @@ -8,8 +8,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.net.HttpHeaders; import io.dropwizard.auth.Auth; import io.lettuce.core.SetArgs; -import io.micrometer.core.instrument.Metrics; -import io.micrometer.core.instrument.Tags; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.responses.ApiResponse; @@ -61,7 +59,6 @@ import org.whispersystems.textsecuregcm.entities.LinkDeviceRequest; import org.whispersystems.textsecuregcm.entities.PreKeySignatureValidator; import org.whispersystems.textsecuregcm.identity.IdentityType; import org.whispersystems.textsecuregcm.limits.RateLimiters; -import org.whispersystems.textsecuregcm.metrics.MetricsUtil; import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisCluster; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; @@ -89,8 +86,6 @@ public class DeviceController { private final Clock clock; - private static final String LINK_DEVICE_COUNTER_NAME = MetricsUtil.name(DeviceController.class, "linkDevice"); - private static final String VERIFICATION_TOKEN_ALGORITHM = "HmacSHA256"; @VisibleForTesting @@ -449,10 +444,6 @@ public class DeviceController { connection.sync().set(getUsedTokenKey(verificationCode), "", new SetArgs().ex(TOKEN_EXPIRATION_DURATION))); } - Metrics.counter(LINK_DEVICE_COUNTER_NAME, - "pniRegistrationIdPresent", String.valueOf(accountAttributes.getPhoneNumberIdentityRegistrationId().isPresent())) - .increment(); - return new Pair<>(updatedAccount, device); } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java index 867836556..44dc4aadb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java @@ -278,7 +278,7 @@ public class AccountsManager { clientPresenceManager.disconnectAllPresencesForUuid(actualUuid); } - Tags tags; + final Tags tags; if (freshUser) { tags = Tags.of("type", maybeRecentlyDeletedAccountIdentifier.isPresent() ? "recently-deleted" : "new"); @@ -286,8 +286,6 @@ public class AccountsManager { tags = Tags.of("type", "re-registration"); } - tags = tags.and("pniRegistrationIdPresent", String.valueOf(accountAttributes.getPhoneNumberIdentityRegistrationId().isPresent())); - Metrics.counter(CREATE_COUNTER_NAME, tags).increment(); accountAttributes.recoveryPassword().ifPresent(registrationRecoveryPassword ->