Tag push challenge attempt metrics by country code

This commit is contained in:
Jon Chambers 2022-03-16 14:45:06 -04:00 committed by Jon Chambers
parent c048074c31
commit 2f6b0b1a55
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import org.whispersystems.textsecuregcm.push.NotPushRegisteredException;
import org.whispersystems.textsecuregcm.storage.Account;
import org.whispersystems.textsecuregcm.storage.Device;
import org.whispersystems.textsecuregcm.storage.PushChallengeDynamoDb;
import org.whispersystems.textsecuregcm.util.Util;
import org.whispersystems.textsecuregcm.util.ua.ClientPlatform;
public class PushChallengeManager {
@ -42,6 +43,7 @@ public class PushChallengeManager {
private static final String PLATFORM_TAG_NAME = "platform";
private static final String SENT_TAG_NAME = "sent";
private static final String SUCCESS_TAG_NAME = "success";
private static final String SOURCE_COUNTRY_TAG_NAME = "sourceCountry";
public PushChallengeManager(final APNSender apnSender, final GCMSender gcmSender,
final PushChallengeDynamoDb pushChallengeDynamoDb) {
@ -108,6 +110,7 @@ public class PushChallengeManager {
Metrics.counter(CHALLENGE_ANSWERED_COUNTER_NAME,
PLATFORM_TAG_NAME, platform,
SOURCE_COUNTRY_TAG_NAME, Util.getCountryCode(account.getNumber()),
SUCCESS_TAG_NAME, String.valueOf(success)).increment();
return success;