mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Adding telemetry framework to migration extension (#15284)
* Adding telemetry to sql-migration * Adding some telemetry helper functions * removing unncessary telemetry * removing unncessary imports * Changing name of telemetry sender methods and removing unused functions. * Removing extra whitespace * Fixing a typo
This commit is contained in:
29
extensions/sql-migration/src/telemtery.ts
Normal file
29
extensions/sql-migration/src/telemtery.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import AdsTelemetryReporter, { TelemetryEventMeasures, TelemetryEventProperties } from '@microsoft/ads-extension-telemetry';
|
||||
import { getPackageInfo } from './api/utils';
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
let packageInfo = getPackageInfo(packageJson)!;
|
||||
|
||||
export const TelemetryReporter = new AdsTelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||
|
||||
export enum TelemetryViews {
|
||||
SqlServerDashboard = 'SqlServerDashboard',
|
||||
MigrationWizard = 'MigrationWizard',
|
||||
CreateDataMigrationServiceDialog = 'CreateDataMigrationServiceDialog',
|
||||
AssessmentsDialog = 'AssessmentsDialog',
|
||||
MigrationCutoverDialog = 'MigrationCutoverDialog',
|
||||
MigrationStatusDialog = 'MigrationStatusDialog',
|
||||
AssessmentsPage = 'AssessmentsPage'
|
||||
}
|
||||
|
||||
export function sendSqlMigrationActionEvent(telemetryView: string, telemetryAction: string, additionalProps: TelemetryEventProperties, additionalMeasurements: TelemetryEventMeasures): void {
|
||||
TelemetryReporter.createActionEvent(telemetryView, telemetryAction)
|
||||
.withAdditionalProperties(additionalProps)
|
||||
.withAdditionalMeasurements(additionalMeasurements)
|
||||
.send();
|
||||
}
|
||||
Reference in New Issue
Block a user