mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Fix MSAL Runtime telemetry not firing (#282595)
We were too strict. This should actually yield telemtry. Fixes https://github.com/microsoft/vscode/issues/282593
This commit is contained in:
committed by
GitHub
parent
71f35296d2
commit
e3bbd5bb1d
@@ -108,9 +108,10 @@ export class MicrosoftAuthenticationTelemetryReporter implements IExperimentatio
|
||||
});
|
||||
}
|
||||
|
||||
sendTelemetryClientAuthErrorEvent(error: ClientAuthError): void {
|
||||
sendTelemetryClientAuthErrorEvent(error: AuthError): void {
|
||||
const errorCode = error.errorCode;
|
||||
const correlationId = error.correlationId;
|
||||
const errorName = error.name;
|
||||
let brokerErrorCode: string | undefined;
|
||||
let brokerStatusCode: string | undefined;
|
||||
let brokerTag: string | undefined;
|
||||
@@ -126,6 +127,7 @@ export class MicrosoftAuthenticationTelemetryReporter implements IExperimentatio
|
||||
"msalClientAuthError" : {
|
||||
"owner": "TylerLeonhardt",
|
||||
"comment": "Used to determine how often users run into client auth errors during the login flow.",
|
||||
"errorName": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The name of the client auth error." },
|
||||
"errorCode": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The client auth error code." },
|
||||
"correlationId": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The client auth error correlation id." },
|
||||
"brokerErrorCode": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The broker error code." },
|
||||
@@ -134,6 +136,7 @@ export class MicrosoftAuthenticationTelemetryReporter implements IExperimentatio
|
||||
}
|
||||
*/
|
||||
this._telemetryReporter.sendTelemetryErrorEvent('msalClientAuthError', {
|
||||
errorName,
|
||||
errorCode,
|
||||
correlationId,
|
||||
brokerErrorCode,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { AccountInfo, AuthenticationResult, ClientAuthError, ClientAuthErrorCodes, ServerError, SilentFlowRequest } from '@azure/msal-node';
|
||||
import { AccountInfo, AuthenticationResult, AuthError, ClientAuthError, ClientAuthErrorCodes, ServerError } from '@azure/msal-node';
|
||||
import { AuthenticationChallenge, AuthenticationConstraint, AuthenticationGetSessionOptions, AuthenticationProvider, AuthenticationProviderAuthenticationSessionsChangeEvent, AuthenticationProviderSessionOptions, AuthenticationSession, AuthenticationSessionAccountInformation, CancellationError, env, EventEmitter, ExtensionContext, ExtensionKind, l10n, LogOutputChannel, Uri, window } from 'vscode';
|
||||
import { Environment } from '@azure/ms-rest-azure-env';
|
||||
import { CachedPublicClientApplicationManager } from './publicClientCache';
|
||||
@@ -522,7 +522,7 @@ 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
|
||||
if (e instanceof ClientAuthError) {
|
||||
if (e instanceof AuthError) {
|
||||
this._telemetryReporter.sendTelemetryClientAuthErrorEvent(e);
|
||||
} else {
|
||||
this._telemetryReporter.sendTelemetryErrorEvent(e);
|
||||
|
||||
Reference in New Issue
Block a user