Adding a couple telemetry points for sql bindings quickpick (#16974)

* adding a couple telemetry points for sql bindings quickpick

* addressing comments
This commit is contained in:
Kim Santiago
2021-09-10 14:08:42 -07:00
committed by GitHub
parent 2d609c9cbc
commit 37e88f9fcd
2 changed files with 14 additions and 2 deletions

View File

@@ -5,8 +5,11 @@ import * as constants from '../common/constants';
import * as utils from '../common/utils';
import * as azureFunctionsUtils from '../common/azureFunctionsUtils';
import { PackageHelper } from '../tools/packageHelper';
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined, packageHelper: PackageHelper): Promise<void> {
TelemetryReporter.sendActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.startAddSqlBinding);
if (!uri) {
// this command only shows in the command palette when the active editor is a .cs file, so we can safely assume that's the scenario
// when this is called without a uri
@@ -115,10 +118,16 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined,
if (!result.success) {
void vscode.window.showErrorMessage(result.errorMessage);
TelemetryReporter.sendErrorEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding);
return;
}
TelemetryReporter.createActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding)
.withAdditionalProperties({ bindingType: selectedBinding.label })
.send();
} catch (e) {
void vscode.window.showErrorMessage(e);
TelemetryReporter.sendErrorEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding);
return;
}