Start sending ClientAuthError telemetry for microsoft auth (#278643)

To better bucketize MSAL broker errors.
This commit is contained in:
Tyler James Leonhardt
2025-11-20 12:27:10 -08:00
committed by GitHub
parent 3dcee1b440
commit 134826b979
4 changed files with 59 additions and 21 deletions

View File

@@ -522,7 +522,11 @@ export class MsalAuthProvider implements AuthenticationProvider {
} catch (e) {
// If we can't get a token silently, the account is probably in a bad state so we should skip it
// MSAL will log this already, so we don't need to log it again
this._telemetryReporter.sendTelemetryErrorEvent(e);
if (e instanceof ClientAuthError) {
this._telemetryReporter.sendTelemetryClientAuthErrorEvent(e);
} else {
this._telemetryReporter.sendTelemetryErrorEvent(e);
}
this._logger.info(`[getAllSessionsForPca] [${scopeData.scopeStr}] [${account.username}] failed to acquire token silently, skipping account`, JSON.stringify(e));
continue;
}