Revert "Add metrics to check presence of PNI-associated registration IDs"
This reverts commit 1da3f96d10
.
This commit is contained in:
parent
c97f837f45
commit
3980dec123
|
@ -59,7 +59,6 @@ import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier;
|
||||||
import org.whispersystems.textsecuregcm.identity.ServiceIdentifier;
|
import org.whispersystems.textsecuregcm.identity.ServiceIdentifier;
|
||||||
import org.whispersystems.textsecuregcm.limits.RateLimitedByIp;
|
import org.whispersystems.textsecuregcm.limits.RateLimitedByIp;
|
||||||
import org.whispersystems.textsecuregcm.limits.RateLimiters;
|
import org.whispersystems.textsecuregcm.limits.RateLimiters;
|
||||||
import org.whispersystems.textsecuregcm.metrics.MetricsUtil;
|
|
||||||
import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil;
|
import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil;
|
||||||
import org.whispersystems.textsecuregcm.storage.Account;
|
import org.whispersystems.textsecuregcm.storage.Account;
|
||||||
import org.whispersystems.textsecuregcm.storage.AccountsManager;
|
import org.whispersystems.textsecuregcm.storage.AccountsManager;
|
||||||
|
@ -87,8 +86,6 @@ public class AccountController {
|
||||||
private final RegistrationRecoveryPasswordsManager registrationRecoveryPasswordsManager;
|
private final RegistrationRecoveryPasswordsManager registrationRecoveryPasswordsManager;
|
||||||
private final UsernameHashZkProofVerifier usernameHashZkProofVerifier;
|
private final UsernameHashZkProofVerifier usernameHashZkProofVerifier;
|
||||||
|
|
||||||
private static final String SET_ATTRIBUTES_COUNTER_NAME = MetricsUtil.name(AccountController.class, "setAttributes");
|
|
||||||
|
|
||||||
public AccountController(
|
public AccountController(
|
||||||
AccountsManager accounts,
|
AccountsManager accounts,
|
||||||
RateLimiters rateLimiters,
|
RateLimiters rateLimiters,
|
||||||
|
@ -247,10 +244,6 @@ public class AccountController {
|
||||||
// if registration recovery password was sent to us, store it (or refresh its expiration)
|
// if registration recovery password was sent to us, store it (or refresh its expiration)
|
||||||
attributes.recoveryPassword().ifPresent(registrationRecoveryPassword ->
|
attributes.recoveryPassword().ifPresent(registrationRecoveryPassword ->
|
||||||
registrationRecoveryPasswordsManager.storeForCurrentNumber(updatedAccount.getNumber(), registrationRecoveryPassword));
|
registrationRecoveryPasswordsManager.storeForCurrentNumber(updatedAccount.getNumber(), registrationRecoveryPassword));
|
||||||
|
|
||||||
Metrics.counter(SET_ATTRIBUTES_COUNTER_NAME,
|
|
||||||
"pniRegistrationIdPresent", String.valueOf(attributes.getPhoneNumberIdentityRegistrationId().isPresent()))
|
|
||||||
.increment();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
|
|
@ -8,8 +8,6 @@ import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.net.HttpHeaders;
|
import com.google.common.net.HttpHeaders;
|
||||||
import io.dropwizard.auth.Auth;
|
import io.dropwizard.auth.Auth;
|
||||||
import io.lettuce.core.SetArgs;
|
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.Operation;
|
||||||
import io.swagger.v3.oas.annotations.headers.Header;
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
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.entities.PreKeySignatureValidator;
|
||||||
import org.whispersystems.textsecuregcm.identity.IdentityType;
|
import org.whispersystems.textsecuregcm.identity.IdentityType;
|
||||||
import org.whispersystems.textsecuregcm.limits.RateLimiters;
|
import org.whispersystems.textsecuregcm.limits.RateLimiters;
|
||||||
import org.whispersystems.textsecuregcm.metrics.MetricsUtil;
|
|
||||||
import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisCluster;
|
import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisCluster;
|
||||||
import org.whispersystems.textsecuregcm.storage.Account;
|
import org.whispersystems.textsecuregcm.storage.Account;
|
||||||
import org.whispersystems.textsecuregcm.storage.AccountsManager;
|
import org.whispersystems.textsecuregcm.storage.AccountsManager;
|
||||||
|
@ -89,8 +86,6 @@ public class DeviceController {
|
||||||
|
|
||||||
private final Clock clock;
|
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";
|
private static final String VERIFICATION_TOKEN_ALGORITHM = "HmacSHA256";
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
@ -449,10 +444,6 @@ public class DeviceController {
|
||||||
connection.sync().set(getUsedTokenKey(verificationCode), "", new SetArgs().ex(TOKEN_EXPIRATION_DURATION)));
|
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);
|
return new Pair<>(updatedAccount, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ public class AccountsManager {
|
||||||
clientPresenceManager.disconnectAllPresencesForUuid(actualUuid);
|
clientPresenceManager.disconnectAllPresencesForUuid(actualUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Tags tags;
|
final Tags tags;
|
||||||
|
|
||||||
if (freshUser) {
|
if (freshUser) {
|
||||||
tags = Tags.of("type", maybeRecentlyDeletedAccountIdentifier.isPresent() ? "recently-deleted" : "new");
|
tags = Tags.of("type", maybeRecentlyDeletedAccountIdentifier.isPresent() ? "recently-deleted" : "new");
|
||||||
|
@ -286,8 +286,6 @@ public class AccountsManager {
|
||||||
tags = Tags.of("type", "re-registration");
|
tags = Tags.of("type", "re-registration");
|
||||||
}
|
}
|
||||||
|
|
||||||
tags = tags.and("pniRegistrationIdPresent", String.valueOf(accountAttributes.getPhoneNumberIdentityRegistrationId().isPresent()));
|
|
||||||
|
|
||||||
Metrics.counter(CREATE_COUNTER_NAME, tags).increment();
|
Metrics.counter(CREATE_COUNTER_NAME, tags).increment();
|
||||||
|
|
||||||
accountAttributes.recoveryPassword().ifPresent(registrationRecoveryPassword ->
|
accountAttributes.recoveryPassword().ifPresent(registrationRecoveryPassword ->
|
||||||
|
|
Loading…
Reference in New Issue