|
101 | 101 | import com.microsoft.identity.common.java.exception.ServiceException; |
102 | 102 | import com.microsoft.identity.common.java.exception.UnsupportedBrokerException; |
103 | 103 | import com.microsoft.identity.common.java.interfaces.IPlatformComponents; |
| 104 | +import com.microsoft.identity.common.java.opentelemetry.OTelUtility; |
104 | 105 | import com.microsoft.identity.common.java.providers.microsoft.MicrosoftRefreshToken; |
105 | 106 | import com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.ClientInfo; |
106 | 107 | import com.microsoft.identity.common.java.providers.microsoft.microsoftsts.MicrosoftStsAccount; |
|
123 | 124 | import java.util.concurrent.ExecutionException; |
124 | 125 | import java.util.concurrent.TimeUnit; |
125 | 126 |
|
| 127 | +import io.opentelemetry.api.metrics.LongCounter; |
126 | 128 | import lombok.EqualsAndHashCode; |
127 | 129 |
|
128 | 130 | /** |
@@ -151,6 +153,12 @@ public class BrokerMsalController extends BaseController { |
151 | 153 |
|
152 | 154 | private String mMaxMsalBrokerProtocolVersion; |
153 | 155 |
|
| 156 | + // telemetry count metric for tracking getCurrentAccount() SDM failures |
| 157 | + private static final LongCounter sGetCurrentAccountFailedNoSDMCount = OTelUtility.createLongCounter( |
| 158 | + "get_current_account_failed_no_sdm_count", |
| 159 | + "Number of failed getCurrentAccount calls due to no SDM" |
| 160 | + ); |
| 161 | + |
154 | 162 | public BrokerMsalController(@NonNull final Context applicationContext, |
155 | 163 | @NonNull final IPlatformComponents components, |
156 | 164 | @NonNull final String activeBrokerPackageName) { |
@@ -947,6 +955,7 @@ List<ICacheRecord> getCurrentAccount(final @NonNull CommandParameters parameters |
947 | 955 |
|
948 | 956 | if (!parameters.isSharedDevice()) { |
949 | 957 | Logger.verbose(TAG + methodName, "Not a shared device, invoke getAccounts() instead of getCurrentAccount()"); |
| 958 | + sGetCurrentAccountFailedNoSDMCount.add(1); // TODO: Any useful attributes? How is this omitted? |
950 | 959 | return getAccounts(parameters); |
951 | 960 | } |
952 | 961 |
|
|
0 commit comments