diff --git a/extensions/mssql/src/constants.ts b/extensions/mssql/src/constants.ts index f415329b73..cd5a92ea5e 100644 --- a/extensions/mssql/src/constants.ts +++ b/extensions/mssql/src/constants.ts @@ -65,6 +65,10 @@ export enum MssqlClusterItemsSubType { Spark = ':spark:' } +export enum TableType { + Basic = 'basic' +} + // SPARK JOB SUBMISSION ////////////////////////////////////////////////////////// export const mssqlClusterNewNotebookTask = 'mssqlCluster.task.newNotebook'; export const mssqlClusterOpenNotebookTask = 'mssqlCluster.task.openNotebook'; diff --git a/extensions/mssql/src/mssql.d.ts b/extensions/mssql/src/mssql.d.ts index 9053c629ee..4d5fd481ca 100644 --- a/extensions/mssql/src/mssql.d.ts +++ b/extensions/mssql/src/mssql.d.ts @@ -6,7 +6,6 @@ // This is the place for extensions to expose APIs. import * as azdata from 'azdata'; -import * as vscode from 'vscode'; /** * Covers defining what the mssql extension exports to other extensions diff --git a/extensions/mssql/src/tableDesigner/tableDesigner.ts b/extensions/mssql/src/tableDesigner/tableDesigner.ts index 2b1dbbb09c..5b25ba2be0 100644 --- a/extensions/mssql/src/tableDesigner/tableDesigner.ts +++ b/extensions/mssql/src/tableDesigner/tableDesigner.ts @@ -8,17 +8,21 @@ import * as azdata from 'azdata'; import * as vscode from 'vscode'; import { sqlProviderName } from '../constants'; import { generateUuid } from 'vscode-languageclient/lib/utils/uuid'; +import { ITelemetryEventProperties, Telemetry } from '../telemetry'; export function registerTableDesignerCommands(appContext: AppContext) { appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.newTable', async (context: azdata.ObjectExplorerContext) => { const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true); + const serverInfo = await azdata.connection.getServerInfo(context.connectionProfile.id); + let telemetryInfo: ITelemetryEventProperties = {}; + telemetryInfo = Telemetry.fillServerInfo(telemetryInfo, serverInfo); await azdata.designers.openTableDesigner(sqlProviderName, { server: context.connectionProfile.serverName, database: context.connectionProfile.databaseName, isNewTable: true, id: generateUuid(), connectionString: connectionString - }); + }, telemetryInfo); })); appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.designTable', async (context: azdata.ObjectExplorerContext) => { @@ -28,6 +32,9 @@ export function registerTableDesignerCommands(appContext: AppContext) { const name = context.nodeInfo.metadata.name; const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true); const connectionUri = await azdata.connection.getUriForConnection(context.connectionProfile.id); + const serverInfo = await azdata.connection.getServerInfo(context.connectionProfile.id); + let telemetryInfo: ITelemetryEventProperties = {}; + telemetryInfo = Telemetry.fillServerInfo(telemetryInfo, serverInfo); await azdata.designers.openTableDesigner(sqlProviderName, { server: server, database: database, @@ -36,6 +43,6 @@ export function registerTableDesignerCommands(appContext: AppContext) { schema: schema, id: `${connectionUri}|${database}|${schema}|${name}`, connectionString: connectionString - }); + }, telemetryInfo); })); } diff --git a/extensions/mssql/src/telemetry.ts b/extensions/mssql/src/telemetry.ts index d7cdd8f68d..a4915f8480 100644 --- a/extensions/mssql/src/telemetry.ts +++ b/extensions/mssql/src/telemetry.ts @@ -10,6 +10,8 @@ import { ErrorAction, ErrorHandler, Message, CloseAction } from 'vscode-language import * as Utils from './utils'; import * as Constants from './constants'; import * as nls from 'vscode-nls'; +import { ServerInfo } from 'azdata'; + const localize = nls.loadMessageBundle(); const packageJson = require('../package.json'); @@ -114,6 +116,20 @@ export class Telemetry { } } + + /** + * Collects server information from ServerInfo to put into a + * property bag + */ + public static fillServerInfo(telemetryInfo: { [key: string]: string }, serverInfo: ServerInfo): { [key: string]: string } { + telemetryInfo['serverEdition'] = serverInfo?.serverEdition; + telemetryInfo['serverLevel'] = serverInfo?.serverLevel; + telemetryInfo['serverMajorVersion'] = serverInfo?.serverMajorVersion.toString(); + telemetryInfo['serverMinorVersion'] = serverInfo?.serverMinorVersion.toString(); + telemetryInfo['isCloud'] = serverInfo?.isCloud.toString(); + telemetryInfo['tableType'] = Constants.TableType.Basic; + return telemetryInfo; + } } /** diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 47d6baef08..a81dec934b 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -1021,8 +1021,9 @@ declare module 'azdata' { * Open a table designer window. * @param providerId The table designer provider Id. * @param tableInfo The table information. The object will be passed back to the table designer provider as the unique identifier for the table. + * @param telemetryInfo: Optional Key-value pair containing any extra information that needs to be sent via telemetry */ - export function openTableDesigner(providerId: string, tableInfo: TableInfo): Thenable; + export function openTableDesigner(providerId: string, tableInfo: TableInfo, telemetryInfo?: { [key: string]: string }): Thenable; /** * Definition for the table designer provider. diff --git a/src/sql/platform/telemetry/common/telemetryKeys.ts b/src/sql/platform/telemetry/common/telemetryKeys.ts index bc00eb699c..bce1b5e89b 100644 --- a/src/sql/platform/telemetry/common/telemetryKeys.ts +++ b/src/sql/platform/telemetry/common/telemetryKeys.ts @@ -70,6 +70,7 @@ export const enum TelemetryAction { ChartCreated = 'ChartCreated', Click = 'Click', FirewallRuleRequested = 'FirewallRuleCreated', + GenerateScript = 'GenerateScript', GetDataGridItems = 'GetDataGridItems', GetDataGridColumns = 'GetDataGridColumns', ModelViewDashboardOpened = 'ModelViewDashboardOpened', @@ -80,6 +81,7 @@ export const enum TelemetryAction { NewQuery = 'NewQuery', ObjectExplorerExpand = 'ObjectExplorerExpand', Open = 'Open', + PublishChanges = 'PublishChanges', RestoreRequested = 'RestoreRequested', RunAgentJob = 'RunAgentJob', RunQuery = 'RunQuery', diff --git a/src/sql/workbench/api/browser/mainThreadDataProtocol.ts b/src/sql/workbench/api/browser/mainThreadDataProtocol.ts index b601fb5f4c..440af71acc 100644 --- a/src/sql/workbench/api/browser/mainThreadDataProtocol.ts +++ b/src/sql/workbench/api/browser/mainThreadDataProtocol.ts @@ -28,7 +28,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; import { serializableToMap } from 'sql/base/common/map'; import { IAssessmentService } from 'sql/workbench/services/assessment/common/interfaces'; import { IDataGridProviderService } from 'sql/workbench/services/dataGridProvider/common/dataGridProviderService'; -import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; +import { IAdsTelemetryService, ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; import { ITableDesignerService } from 'sql/workbench/services/tableDesigner/common/interface'; @@ -646,8 +646,8 @@ export class MainThreadDataProtocol extends Disposable implements MainThreadData } // Table Designer - public $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): void { - this._tableDesignerService.openTableDesigner(providerId, tableInfo); + public $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): void { + this._tableDesignerService.openTableDesigner(providerId, tableInfo, telemetryInfo); } public $unregisterProvider(handle: number): Promise { diff --git a/src/sql/workbench/api/common/extHostDataProtocol.ts b/src/sql/workbench/api/common/extHostDataProtocol.ts index 3e1d96e144..5d8b0c86e2 100644 --- a/src/sql/workbench/api/common/extHostDataProtocol.ts +++ b/src/sql/workbench/api/common/extHostDataProtocol.ts @@ -14,6 +14,7 @@ import { IURITransformer } from 'vs/base/common/uriIpc'; import { URI, UriComponents } from 'vs/base/common/uri'; import { RunOnceScheduler } from 'vs/base/common/async'; import { mapToSerializable } from 'sql/base/common/map'; +import { ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; export class ExtHostDataProtocol extends ExtHostDataProtocolShape { @@ -916,8 +917,8 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape { return this._resolveProvider(handle).disposeTableDesigner(table); } - public override $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): Promise { - this._proxy.$openTableDesigner(providerId, tableInfo); + public override $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): Promise { + this._proxy.$openTableDesigner(providerId, tableInfo, telemetryInfo); return Promise.resolve(); } } diff --git a/src/sql/workbench/api/common/sqlExtHost.api.impl.ts b/src/sql/workbench/api/common/sqlExtHost.api.impl.ts index e955645858..b086857612 100644 --- a/src/sql/workbench/api/common/sqlExtHost.api.impl.ts +++ b/src/sql/workbench/api/common/sqlExtHost.api.impl.ts @@ -36,6 +36,7 @@ import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; import { ExtHostWorkspace } from 'sql/workbench/api/common/extHostWorkspace'; import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; import { URI } from 'vs/base/common/uri'; +import { ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; export interface IAzdataExtensionApiFactory { (extension: IExtensionDescription): typeof azdata; @@ -578,8 +579,8 @@ export function createAdsApiFactory(accessor: ServicesAccessor): IAdsExtensionAp TableIndexProperty: sqlExtHostTypes.designers.TableIndexProperty, TableIndexColumnSpecificationProperty: sqlExtHostTypes.designers.TableIndexColumnSpecificationProperty, DesignerEditType: sqlExtHostTypes.designers.DesignerEditType, - openTableDesigner(providerId, tableInfo: azdata.designers.TableInfo): Promise { - return extHostDataProvider.$openTableDesigner(providerId, tableInfo); + openTableDesigner(providerId, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): Promise { + return extHostDataProvider.$openTableDesigner(providerId, tableInfo, telemetryInfo); } }; diff --git a/src/sql/workbench/api/common/sqlExtHost.protocol.ts b/src/sql/workbench/api/common/sqlExtHost.protocol.ts index d7cb3e9654..c3a24a51ad 100644 --- a/src/sql/workbench/api/common/sqlExtHost.protocol.ts +++ b/src/sql/workbench/api/common/sqlExtHost.protocol.ts @@ -28,6 +28,7 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' import { IQueryEvent } from 'sql/workbench/services/query/common/queryModel'; import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor'; import { TreeDataTransferDTO } from 'vs/workbench/api/common/shared/treeDataTransfer'; +import { ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; export abstract class ExtHostAccountManagementShape { $autoOAuthCancelled(handle: number): Thenable { throw ni(); } @@ -560,7 +561,7 @@ export abstract class ExtHostDataProtocolShape { /** * Open a new instance of table designer. */ - $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, designerInfo: azdata.designers.TableDesignerInfo): void { throw ni(); } + $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): void { throw ni(); } } /** @@ -650,7 +651,7 @@ export interface MainThreadDataProtocolShape extends IDisposable { $onSessionStopped(handle: number, response: azdata.ProfilerSessionStoppedParams): void; $onProfilerSessionCreated(handle: number, response: azdata.ProfilerSessionCreatedParams): void; $onJobDataUpdated(handle: Number): void; - $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): void; + $openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): void; /** * Callback when a session has completed initialization diff --git a/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts b/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts index b636b7ef1b..b4988a3bd5 100644 --- a/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts +++ b/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts @@ -27,11 +27,12 @@ export class TableDesignerInput extends EditorInput { constructor( private _provider: TableDesignerProvider, private _tableInfo: azdata.designers.TableInfo, + telemetryInfo: { [key: string]: string }, @IInstantiationService private readonly _instantiationService: IInstantiationService, @IEditorService editorService: IEditorService, @INotificationService private readonly _notificationService: INotificationService) { super(); - this._designerComponentInput = this._instantiationService.createInstance(TableDesignerComponentInput, this._provider, this._tableInfo); + this._designerComponentInput = this._instantiationService.createInstance(TableDesignerComponentInput, this._provider, this._tableInfo, telemetryInfo); this._register(this._designerComponentInput.onStateChange((e) => { if (e.currentState.dirty !== e.previousState.dirty) { this._onDidChangeDirty.fire(); diff --git a/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts b/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts index 25169fbc8c..178b6393c1 100644 --- a/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts +++ b/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; -import { DesignerViewModel, DesignerEdit, DesignerComponentInput, DesignerView, DesignerTab, DesignerDataPropertyInfo, DropDownProperties, DesignerTableProperties, DesignerEditProcessedEventArgs, DesignerAction, DesignerStateChangedEventArgs } from 'sql/workbench/browser/designer/interfaces'; +import { DesignerViewModel, DesignerEdit, DesignerComponentInput, DesignerView, DesignerTab, DesignerDataPropertyInfo, DropDownProperties, DesignerTableProperties, DesignerEditProcessedEventArgs, DesignerAction, DesignerStateChangedEventArgs, DesignerEditPath } from 'sql/workbench/browser/designer/interfaces'; import { TableDesignerProvider } from 'sql/workbench/services/tableDesigner/common/interface'; import { localize } from 'vs/nls'; import { designers } from 'sql/workbench/api/common/sqlExtHostTypes'; @@ -14,6 +14,8 @@ import { deepClone, equals } from 'vs/base/common/objects'; import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TableDesignerPublishDialogResult, TableDesignerPublishDialog } from 'sql/workbench/services/tableDesigner/browser/tableDesignerPublishDialog'; +import { IAdsTelemetryService, ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; +import { TelemetryAction, TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys'; export class TableDesignerComponentInput implements DesignerComponentInput { @@ -31,9 +33,15 @@ export class TableDesignerComponentInput implements DesignerComponentInput { public readonly onEditProcessed: Event = this._onEditProcessed.event; public readonly onStateChange: Event = this._onStateChange.event; + private readonly designerEditTypeDisplayValue: { [key: number]: string } = { + 0: 'Add', 1: 'Remove', 2: 'Update' + }; + constructor(private readonly _provider: TableDesignerProvider, private _tableInfo: azdata.designers.TableInfo, + private _telemetryInfo: ITelemetryEventProperties, @INotificationService private readonly _notificationService: INotificationService, + @IAdsTelemetryService readonly _adsTelemetryService: IAdsTelemetryService, @IQueryEditorService private readonly _queryEditorService: IQueryEditorService, @IInstantiationService private readonly _instantiationService: IInstantiationService) { } @@ -63,6 +71,11 @@ export class TableDesignerComponentInput implements DesignerComponentInput { } processEdit(edit: DesignerEdit): void { + const telemetryInfo = this.createTelemetryInfo(); + telemetryInfo.tableObjectType = this.getObjectTypeFromPath(edit.path); + const editAction = this._adsTelemetryService.createActionEvent(TelemetryView.TableDesigner, + this.designerEditTypeDisplayValue[edit.type]).withAdditionalProperties(telemetryInfo); + const startTime = new Date().getTime(); this.updateState(this.valid, this.dirty, 'processEdit'); this._provider.processTableEdit(this._tableInfo, edit).then( result => { @@ -76,10 +89,15 @@ export class TableDesignerComponentInput implements DesignerComponentInput { errors: result.errors } }); + editAction.withAdditionalMeasurements({ + 'elapsedTimeMs': new Date().getTime() - startTime + }).send(); }, error => { this._notificationService.error(localize('tableDesigner.errorProcessingEdit', "An error occured while processing the change: {0}", error?.message ?? error)); this.updateState(this.valid, this.dirty); + this._adsTelemetryService.createErrorEvent(TelemetryView.TableDesigner, + this.designerEditTypeDisplayValue[edit.type]).withAdditionalProperties(telemetryInfo).send(); } ); } @@ -90,35 +108,49 @@ export class TableDesignerComponentInput implements DesignerComponentInput { message: localize('tableDesigner.generatingScript', "Generating script..."), sticky: true }); + const telemetryInfo = this.createTelemetryInfo(); + const generateScriptEvent = this._adsTelemetryService.createActionEvent(TelemetryView.TableDesigner, TelemetryAction.GenerateScript).withAdditionalProperties(telemetryInfo); + const startTime = new Date().getTime(); try { this.updateState(this.valid, this.dirty, 'generateScript'); const script = await this._provider.generateScript(this._tableInfo); this._queryEditorService.newSqlEditor({ initalContent: script }); this.updateState(this.valid, this.dirty); notificationHandle.updateMessage(localize('tableDesigner.generatingScriptCompleted', "Script generated.")); + generateScriptEvent.withAdditionalMeasurements({ + 'elapsedTimeMs': new Date().getTime() - startTime + }).send(); } catch (error) { notificationHandle.updateSeverity(Severity.Error); notificationHandle.updateMessage(localize('tableDesigner.generateScriptError', "An error occured while generating the script: {0}", error?.message ?? error)); this.updateState(this.valid, this.dirty); + this._adsTelemetryService.createErrorEvent(TelemetryView.TableDesigner, TelemetryAction.GenerateScript).withAdditionalProperties(telemetryInfo).send(); } } async publishChanges(): Promise { + const telemetryInfo = this.createTelemetryInfo(); + const publishEvent = this._adsTelemetryService.createActionEvent(TelemetryView.TableDesigner, TelemetryAction.PublishChanges).withAdditionalProperties(telemetryInfo); const saveNotificationHandle = this._notificationService.notify({ severity: Severity.Info, message: localize('tableDesigner.savingChanges', "Saving table designer changes..."), sticky: true }); + const startTime = new Date().getTime(); try { this.updateState(this.valid, this.dirty, 'save'); await this._provider.publishChanges(this._tableInfo); this._originalViewModel = this._viewModel; this.updateState(true, false); saveNotificationHandle.updateMessage(localize('tableDesigner.publishChangeSuccess', "The changes have been successfully published.")); + publishEvent.withAdditionalMeasurements({ + 'elapsedTimeMs': new Date().getTime() - startTime + }).send(); } catch (error) { saveNotificationHandle.updateSeverity(Severity.Error); saveNotificationHandle.updateMessage(localize('tableDesigner.publishChangeError', "An error occured while publishing changes: {0}", error?.message ?? error)); this.updateState(this.valid, this.dirty); + this._adsTelemetryService.createErrorEvent(TelemetryView.TableDesigner, TelemetryAction.PublishChanges).withAdditionalProperties(telemetryInfo).send(); } } @@ -580,4 +612,36 @@ export class TableDesignerComponentInput implements DesignerComponentInput { this._viewModel[property] = {}; } } + + private createTelemetryInfo(): ITelemetryEventProperties { + let telemetryInfo = { + provider: this._provider.providerId, + isNewTable: this._tableInfo.isNewTable, + }; + Object.assign(telemetryInfo, this._telemetryInfo); + return telemetryInfo; + } + + /** + * 1. 'Add' scenario + a. ['propertyName1']. Example: add a column to the columns property: ['columns']. + b. ['propertyName1',index-1,'propertyName2']. Example: add a column mapping to the first foreign key: ['foreignKeys',0,'mappings']. + 2. 'Update' scenario + a. ['propertyName1']. Example: update the name of the table: ['name']. + b. ['propertyName1',index-1,'propertyName2']. Example: update the name of a column: ['columns',0,'name']. + c. ['propertyName1',index-1,'propertyName2',index-2,'propertyName3']. Example: update the source column of an entry in a foreign key's column mapping table: ['foreignKeys',0,'mappings',0,'source']. + 3. 'Remove' scenario + a. ['propertyName1',index-1]. Example: remove a column from the columns property: ['columns',0']. + b. ['propertyName1',index-1,'proper + The return values would be the propertyNames followed by slashes in level order. Eg.: propertyName1/propertyName2/... + */ + private getObjectTypeFromPath(path: DesignerEditPath): string { + let typeArray = []; + for (let i = 0; i < path.length; i++) { + if (i % 2 === 0) { + typeArray.push(path[i]); + } + } + return typeArray.join('/'); + } } diff --git a/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts b/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts index 78c36341ba..2ff54f9517 100644 --- a/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts +++ b/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts @@ -9,7 +9,7 @@ import * as azdata from 'azdata'; import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { TableDesignerInput } from 'sql/workbench/browser/editor/tableDesigner/tableDesignerInput'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; +import { IAdsTelemetryService, ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; import { TelemetryAction, TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys'; export class TableDesignerService implements ITableDesignerService { @@ -43,13 +43,13 @@ export class TableDesignerService implements ITableDesignerService { throw invalidProvider(providerId); } - public async openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): Promise { + public async openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): Promise { this._adsTelemetryService.createActionEvent(TelemetryView.TableDesigner, TelemetryAction.Open).withAdditionalProperties({ provider: providerId, newTable: tableInfo.isNewTable }).send(); const provider = this.getProvider(providerId); - const tableDesignerInput = this._instantiationService.createInstance(TableDesignerInput, provider, tableInfo); + const tableDesignerInput = this._instantiationService.createInstance(TableDesignerInput, provider, tableInfo, telemetryInfo); await this._editorService.openEditor(tableDesignerInput, { pinned: true }, ACTIVE_GROUP); } } diff --git a/src/sql/workbench/services/tableDesigner/common/interface.ts b/src/sql/workbench/services/tableDesigner/common/interface.ts index efe40ccb0c..2918f7fec5 100644 --- a/src/sql/workbench/services/tableDesigner/common/interface.ts +++ b/src/sql/workbench/services/tableDesigner/common/interface.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; +import { ITelemetryEventProperties } from 'sql/platform/telemetry/common/telemetry'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; @@ -36,5 +37,5 @@ export interface ITableDesignerService { * @param providerId The provider id * @param tableInfo The table information */ - openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): Promise; + openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo, telemetryInfo?: ITelemetryEventProperties): Promise; }