Update ads-extension-telemetry to 1.3.1 (#20724)

* Update ads-extension-telemetry to 1.3.0

* fix
This commit is contained in:
Charles Gagnon
2022-10-04 23:06:53 -07:00
committed by GitHub
parent 08341c70fd
commit 60c1c8a89f
37 changed files with 92 additions and 130 deletions

View File

@@ -63,7 +63,7 @@
}
},
"dependencies": {
"@microsoft/ads-extension-telemetry": "^1.2.0",
"@microsoft/ads-extension-telemetry": "^1.3.1",
"@microsoft/vscode-azext-utils": "^0.1.1",
"fast-glob": "^3.2.7",
"promisify-child-process": "^3.1.1",

View File

@@ -7,7 +7,7 @@ import { getPackageInfo } from './utils';
const packageInfo = getPackageInfo()!;
export const TelemetryReporter = new AdsTelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
export const TelemetryReporter = new AdsTelemetryReporter<TelemetryViews, TelemetryActions | CreateAzureFunctionStep>(packageInfo.name, packageInfo.version, packageInfo.aiKey);
export enum TelemetryViews {
SqlBindingsQuickPick = 'SqlBindingsQuickPick',
@@ -51,6 +51,8 @@ export enum CreateAzureFunctionStep {
getTemplateId = 'getTemplateId',
getConnectionStringSettingName = 'getConnectionStringSettingName',
promptForIncludePassword = 'promptForIncludePassword',
createFunctionAPI = 'createFunctionAPI',
finishCreateFunction = 'finishCreateFunction'
}
export enum ExitReason {

View File

@@ -21,7 +21,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
// telemetry properties for create azure function
let sessionId: string = uuid.v4();
let propertyBag: { [key: string]: string } = { sessionId: sessionId };
let telemetryStep: string = '';
let telemetryStep: CreateAzureFunctionStep | undefined = undefined;
let exitReason: string = ExitReason.cancelled;
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.startCreateAzureFunctionWithSqlBinding);
let connectionInfo: IConnectionInfo | undefined;
@@ -239,7 +239,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
let connectionStringExecuteStep = createAddConnectionStringStep(projectFolder, connectionInfo, connectionStringInfo.connectionStringSettingName);
// create C# Azure Function with SQL Binding
telemetryStep = 'createFunctionAPI';
telemetryStep = CreateAzureFunctionStep.createFunctionAPI;
await azureFunctionApi.createFunction({
language: 'C#',
targetFramework: 'netcoreapp3.1',
@@ -263,7 +263,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
.withAdditionalProperties(propertyBag)
.withConnectionInfo(connectionInfo).send();
telemetryStep = 'finishCreateFunction';
telemetryStep = CreateAzureFunctionStep.finishCreateFunction;
propertyBag.telemetryStep = telemetryStep;
exitReason = ExitReason.finishCreate;
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.finishCreateAzureFunctionWithSqlBinding)
@@ -271,7 +271,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
.withConnectionInfo(connectionInfo).send();
} catch (error) {
let errorType = utils.getErrorType(error);
propertyBag.telemetryStep = telemetryStep;
propertyBag.telemetryStep = telemetryStep ?? '';
// an error occurred during createFunction
exitReason = ExitReason.error;
void vscode.window.showErrorMessage(constants.errorNewAzureFunction(error));
@@ -279,7 +279,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
.withAdditionalProperties(propertyBag).send();
return;
} finally {
propertyBag.telemetryStep = telemetryStep;
propertyBag.telemetryStep = telemetryStep ?? '';
propertyBag.exitReason = exitReason;
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.exitCreateAzureFunctionQuickpick)
.withAdditionalProperties(propertyBag).send();

View File

@@ -240,10 +240,10 @@
"@microsoft/applicationinsights-shims" "^2.0.1"
"@microsoft/dynamicproto-js" "^1.1.6"
"@microsoft/ads-extension-telemetry@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@microsoft/ads-extension-telemetry/-/ads-extension-telemetry-1.2.0.tgz#f54e464ac887440727fe9862f8ff32be17aeab3a"
integrity sha512-dEp+RVJYo4uebMLvBJqJF8IABufJRp+PWHZx+3xe6SgAC37oYhcwR/glExhp3Nj3A2v3vjso6YQ/Wd5TG27FPQ==
"@microsoft/ads-extension-telemetry@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@microsoft/ads-extension-telemetry/-/ads-extension-telemetry-1.3.1.tgz#fa757ee88eac91b21c3a68562da6441c2ad15c39"
integrity sha512-8Zd7RwwN7ZufMoWFmc1bwzmQc1RV7/jf/Ua33YL1+P0ZwHoWFOhf/b0lwvAVzi9TB/7oD5zA5yv7A/i2sSTn6Q==
dependencies:
"@vscode/extension-telemetry" "^0.6.2"