diff --git a/extensions/sql-migration/src/models/loginMigrationModel.ts b/extensions/sql-migration/src/models/loginMigrationModel.ts index 653bb67c89..aef0dacc5c 100644 --- a/extensions/sql-migration/src/models/loginMigrationModel.ts +++ b/extensions/sql-migration/src/models/loginMigrationModel.ts @@ -76,6 +76,7 @@ export class LoginMigrationModel { private _currentStepIdx: number = 0; private _logins: Map; private _loginMigrationSteps: LoginMigrationStep[] = []; + public errorCountList: string[] = []; constructor() { this.resultsPerStep = new Map(); @@ -179,7 +180,19 @@ export class LoginMigrationModel { } } - this.errorCountMap.set(LoginMigrationStep[step], errorBuckets); + // Making a string of the map elements of errorBuckets + const errorBucketsString = JSON.stringify( + Array.from(errorBuckets.entries()).reduce((o: any, [key, value]) => { + o[key] = value; + return o; + }, {}) + ); + + // Retaining this step in case a revert is needed, but we will be using errorCountList for telemetry + this.errorCountMap.set(LoginMigrationStep[step], errorBucketsString); + + // Creating an array of the error codes and its counts for each step + this.errorCountList.push(`[${LoginMigrationStep[step]}: ${errorBucketsString}]`); } private setDurationPerStep(step: LoginMigrationStep, result: contracts.StartLoginMigrationResult) { diff --git a/extensions/sql-migration/src/wizard/loginMigrationStatusPage.ts b/extensions/sql-migration/src/wizard/loginMigrationStatusPage.ts index ce6b50f84e..e68c201714 100644 --- a/extensions/sql-migration/src/wizard/loginMigrationStatusPage.ts +++ b/extensions/sql-migration/src/wizard/loginMigrationStatusPage.ts @@ -458,7 +458,7 @@ export class LoginMigrationStatusPage extends MigrationWizardPage { { ...getTelemetryProps(this.migrationStateModel), 'loginsAuthType': this.migrationStateModel._loginMigrationModel.loginsAuthType, - 'numberLoginsFailingPerStep': JSON.stringify(Array.from(this.migrationStateModel._loginMigrationModel.errorCountMap)), + 'numberLoginsFailingPerStep': this.migrationStateModel._loginMigrationModel.errorCountList.toString(), 'durationPerStepTimestamp': JSON.stringify(Array.from(this.migrationStateModel._loginMigrationModel.durationPerStep)), 'hasSystemError': JSON.stringify(this.migrationStateModel._loginMigrationModel.hasSystemError), },