Add telemetry for what users have in publish profile (#19805)

* add telemetry for what users have in publish profile

* simplify check

* add falsy checks
This commit is contained in:
Kim Santiago
2022-06-23 13:43:08 -07:00
committed by GitHub
parent 0e09435285
commit ec57115383
2 changed files with 10 additions and 1 deletions

View File

@@ -44,5 +44,6 @@ export enum TelemetryActions {
generateProjectFromOpenApiSpec = 'generateProjectFromOpenApiSpec',
publishOptionsOpened = 'publishOptionsOpened',
resetOptions = 'resetOptions',
optionsChanged = 'optionsChanged'
optionsChanged = 'optionsChanged',
profileLoaded = 'profileLoaded'
}

View File

@@ -12,6 +12,7 @@ import * as vscode from 'vscode';
import { promises as fs } from 'fs';
import { SqlConnectionDataSource } from '../dataSources/sqlConnectionStringSource';
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../../common/telemetry';
// only reading db name, connection string, and SQLCMD vars from profile for now
export interface PublishProfile {
@@ -55,6 +56,13 @@ export async function load(profileUri: vscode.Uri, dacfxService: utils.IDacFxSer
// get all SQLCMD variables to include from the profile
const sqlCmdVariables = utils.readSqlCmdVariables(profileXmlDoc, true);
TelemetryReporter.createActionEvent(TelemetryViews.SqlProjectPublishDialog, TelemetryActions.profileLoaded)
.withAdditionalProperties({
hasTargetDbName: (!!targetDbName).toString(),
hasConnectionString: (!!connectionInfo?.connectionId).toString(),
hasSqlCmdVariables: (Object.keys(sqlCmdVariables).length > 0).toString()
}).send();
return {
databaseName: targetDbName,
serverName: connectionInfo.server,