Cleanup telemetry keys (#14795)

* Add event for connection error

* Cleanup telemetry keys

* Fix missed keys
This commit is contained in:
Charles Gagnon
2021-03-18 15:52:57 -07:00
committed by GitHub
parent af19f93b78
commit 31ce58a8fc
28 changed files with 88 additions and 89 deletions

View File

@@ -478,14 +478,14 @@ export class MainThreadDataProtocol extends Disposable implements MainThreadData
providerId: providerId,
title: title,
getDataGridItems(): Thenable<azdata.DataGridItem[]> {
self._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.GetDataGridItems)
self._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.GetDataGridItems)
.withAdditionalProperties({
provider: providerId
}).send();
return self._proxy.$getDataGridItems(handle);
},
getDataGridColumns(): Thenable<azdata.DataGridColumn[]> {
self._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.GetDataGridColumns)
self._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.GetDataGridColumns)
.withAdditionalProperties({
provider: providerId
}).send();

View File

@@ -31,7 +31,7 @@ export abstract class CalloutDialog<T> extends Modal {
) {
super(
title,
TelemetryKeys.CalloutDialog,
TelemetryKeys.ModalDialogName.CalloutDialog,
telemetryService,
layoutService,
clipboardService,

View File

@@ -37,7 +37,7 @@ export class BackupDialog extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super('', TelemetryKeys.Backup, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { isAngular: true, hasErrors: true });
super('', TelemetryKeys.ModalDialogName.Backup, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { isAngular: true, hasErrors: true });
}
protected renderBody(container: HTMLElement) {

View File

@@ -175,7 +175,7 @@ export const DashboardModule = (params, selector: string, instantiationService:
this._router.events.subscribe(e => {
if (e instanceof NavigationEnd) {
this.navigations++;
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.DashboardNavigated)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.DashboardNavigated)
.withAdditionalProperties({ numberOfNavigations: this.navigations })
.send();
}

View File

@@ -76,7 +76,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
this._hasError = true;
this._changeRef.detectChanges();
}
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ChartCreated)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.ChartCreated)
.withAdditionalProperties({ type: this.chartType })
.send();
}

View File

@@ -66,7 +66,7 @@ export class ImageCalloutDialog extends Modal {
) {
super(
title,
TelemetryKeys.CalloutDialog,
TelemetryKeys.ModalDialogName.CalloutDialog,
telemetryService,
layoutService,
clipboardService,

View File

@@ -56,7 +56,7 @@ export class LinkCalloutDialog extends Modal {
) {
super(
title,
TelemetryKeys.CalloutDialog,
TelemetryKeys.ModalDialogName.CalloutDialog,
telemetryService,
layoutService,
clipboardService,

View File

@@ -49,7 +49,7 @@ export class WebViewDialog extends Modal {
@IWebviewService private readonly webviewService: IWebviewService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super('', TelemetryKeys.WebView, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true });
super('', TelemetryKeys.ModalDialogName.WebView, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true });
this._okLabel = localize('webViewDialog.ok', "OK");
this._closeLabel = localize('webViewDialog.close', "Close");
}

View File

@@ -167,7 +167,7 @@ export class AccountDialog extends Modal {
) {
super(
localize('linkedAccounts', "Linked accounts"),
TelemetryKeys.Accounts,
TelemetryKeys.ModalDialogName.Accounts,
telemetryService,
layoutService,
clipboardService,

View File

@@ -55,7 +55,7 @@ export class AutoOAuthDialog extends Modal {
) {
super(
'',
TelemetryKeys.AutoOAuth,
TelemetryKeys.ModalDialogName.AutoOAuth,
telemetryService,
layoutService,
clipboardService,

View File

@@ -32,7 +32,7 @@ export class AdvancedPropertiesController {
public get advancedDialog() {
if (!this._advancedDialog) {
this._advancedDialog = this._instantiationService.createInstance(
OptionsDialog, localize('connectionAdvancedProperties', "Advanced Properties"), TelemetryKeys.ConnectionAdvancedProperties, { hasBackButton: true, cancelLabel: localize('advancedProperties.discard', "Discard") });
OptionsDialog, localize('connectionAdvancedProperties', "Advanced Properties"), TelemetryKeys.ModalDialogName.ConnectionAdvancedProperties, { hasBackButton: true, cancelLabel: localize('advancedProperties.discard', "Discard") });
this._advancedDialog.onCloseEvent(() => this._onCloseAdvancedProperties());
this._advancedDialog.onOk(() => this.handleOnOk());
this._advancedDialog.render();

View File

@@ -113,7 +113,7 @@ export class ConnectionDialogWidget extends Modal {
) {
super(
localize('connection', "Connection"),
TelemetryKeys.Connection,
TelemetryKeys.ModalDialogName.Connection,
telemetryService,
layoutService,
clipboardService,

View File

@@ -669,7 +669,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
public saveProfileGroup(profile: IConnectionProfileGroup): Promise<string> {
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.AddServerGroup);
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.AddServerGroup);
return this._connectionStore.saveProfileGroup(profile).then(groupId => {
this._onAddConnectionProfile.fire(undefined);
return groupId;
@@ -954,7 +954,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
connection.extensionTimer.stop();
connection.connectHandler(true);
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.DatabaseConnected)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.DatabaseConnected)
.withConnectionInfo(connection.connectionProfile)
.withServerInfo(connection.serverInfo)
.withAdditionalMeasurements({
@@ -968,7 +968,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
} else {
connection.connectHandler(false, info.errorMessage, info.errorNumber, info.messages);
this._telemetryService.createErrorEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.DatabaseConnectionError, info.errorNumber.toString())
this._telemetryService.createErrorEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryError.DatabaseConnectionError, info.errorNumber.toString())
.withConnectionInfo(connection.connectionProfile)
.withAdditionalMeasurements({
extensionConnectionTimeMs: connection.extensionTimer.elapsed() - connection.serviceTimer.elapsed(),
@@ -996,13 +996,13 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
public changeGroupIdForConnectionGroup(source: ConnectionProfileGroup, target: ConnectionProfileGroup): Promise<void> {
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.MoveServerConnection);
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.MoveServerConnection);
return this._connectionStore.changeGroupIdForConnectionGroup(source, target);
}
public changeGroupIdForConnection(source: ConnectionProfile, targetGroupId: string): Promise<void> {
let id = Utils.generateUri(source);
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.MoveServerGroup);
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.MoveServerGroup);
return this._connectionStore.changeGroupIdForConnection(source, targetGroupId).then(result => {
this._onAddConnectionProfile.fire(source);
if (id && targetGroupId) {
@@ -1147,7 +1147,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
return this.doDisconnect(uri, profile).then(result => {
if (result) {
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.DatabaseDisconnected)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.DatabaseDisconnected)
.withConnectionInfo(profile)
.withServerInfo(info?.serverInfo)
.send();
@@ -1264,7 +1264,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
* Disconnects a connection before removing from settings.
*/
public deleteConnection(connection: ConnectionProfile): Promise<boolean> {
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.DeleteConnection)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.DeleteConnection)
.withAdditionalProperties({
provider: connection.providerName
}).send();
@@ -1297,7 +1297,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
* Disconnects a connection before removing from config. If disconnect fails, settings is not modified.
*/
public deleteConnectionGroup(group: ConnectionProfileGroup): Promise<boolean> {
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.DeleteServerGroup);
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.DeleteServerGroup);
// Get all connections for this group
let connections = ConnectionProfileGroup.getConnectionsInGroup(group);

View File

@@ -117,7 +117,7 @@ export class NewDashboardTabDialog extends Modal {
) {
super(
localize('newDashboardTab.openDashboardExtensions', "Open dashboard extensions"),
TelemetryKeys.AddNewDashboardTab,
TelemetryKeys.ModalDialogName.AddNewDashboardTab,
telemetryService,
layoutService,
clipboardService,

View File

@@ -52,7 +52,7 @@ export class ErrorMessageDialog extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super('', TelemetryKeys.ErrorMessage, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true });
super('', TelemetryKeys.ModalDialogName.ErrorMessage, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true });
this._okLabel = localize('errorMessageDialog.ok', "OK");
this._closeLabel = localize('errorMessageDialog.close', "Close");
}

View File

@@ -59,7 +59,7 @@ export class FileBrowserDialog extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(title, TelemetryKeys.Backup, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'flyout', hasTitleIcon: false, hasBackButton: true, hasSpinner: true });
super(title, TelemetryKeys.ModalDialogName.FileBrowser, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'flyout', hasTitleIcon: false, hasBackButton: true, hasSpinner: true });
this._viewModel = this._instantiationService.createInstance(FileBrowserViewModel);
this._viewModel.onAddFileTree(args => this.handleOnAddFileTree(args.rootNode, args.selectedNode, args.expandedNodes).catch(err => onUnexpectedError(err)));
this._viewModel.onPathValidate(args => this.handleOnValidate(args.succeeded, args.message));

View File

@@ -195,7 +195,7 @@ export class InsightsDialogView extends Modal {
@ICapabilitiesService private readonly _capabilitiesService: ICapabilitiesService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(nls.localize("InsightsDialogTitle", "Insights"), TelemetryKeys.Insights, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
super(nls.localize("InsightsDialogTitle", "Insights"), TelemetryKeys.ModalDialogName.Insights, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
this._model.onDataChange(e => this.build());
}

View File

@@ -357,7 +357,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
public async expandNode(providerId: string, session: azdata.ObjectExplorerSession, nodePath: string): Promise<azdata.ObjectExplorerExpandInfo> {
const provider = this._providers[providerId];
if (provider) {
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ObjectExplorerExpand)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.ObjectExplorerExpand)
.withAdditionalProperties({
refresh: false,
provider: providerId
@@ -494,7 +494,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
public refreshNode(providerId: string, session: azdata.ObjectExplorerSession, nodePath: string): Promise<azdata.ObjectExplorerExpandInfo | undefined> {
let provider = this._providers[providerId];
if (provider) {
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ObjectExplorerExpand)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.ObjectExplorerExpand)
.withAdditionalProperties({
refresh: true,
provider: providerId

View File

@@ -307,7 +307,7 @@ export class ProfilerColumnEditorDialog extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(nls.localize('profilerColumnDialog.profiler', "Profiler"), TelemetryKeys.Profiler, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
super(nls.localize('profilerColumnDialog.profiler', "Profiler"), TelemetryKeys.ModalDialogName.Profiler, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
}
public render(): void {

View File

@@ -83,7 +83,7 @@ export class ProfilerFilterDialog extends Modal {
@IProfilerService private profilerService: IProfilerService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super('', TelemetryKeys.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true });
super('', TelemetryKeys.ModalDialogName.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: true });
}
public open(input: ProfilerInput) {

View File

@@ -215,28 +215,28 @@ export class QueryManagementService implements IQueryManagementService {
}
public cancelQuery(ownerUri: string): Promise<QueryCancelResult> {
this.addTelemetry(TelemetryKeys.CancelQuery, ownerUri);
this.addTelemetry(TelemetryKeys.TelemetryAction.CancelQuery, ownerUri);
return this._runAction(ownerUri, (runner) => {
return runner.cancelQuery(ownerUri);
});
}
public runQuery(ownerUri: string, range?: IRange, runOptions?: ExecutionPlanOptions): Promise<void> {
this.addTelemetry(TelemetryKeys.RunQuery, ownerUri, runOptions);
this.addTelemetry(TelemetryKeys.TelemetryAction.RunQuery, ownerUri, runOptions);
return this._runAction(ownerUri, (runner) => {
return runner.runQuery(ownerUri, rangeToSelectionData(range), runOptions);
});
}
public runQueryStatement(ownerUri: string, line: number, column: number): Promise<void> {
this.addTelemetry(TelemetryKeys.RunQueryStatement, ownerUri);
this.addTelemetry(TelemetryKeys.TelemetryAction.RunQueryStatement, ownerUri);
return this._runAction(ownerUri, (runner) => {
return runner.runQueryStatement(ownerUri, line - 1, column - 1); // we are taking in a vscode IRange which is 1 indexed, but our api expected a 0 index
});
}
public runQueryString(ownerUri: string, queryString: string): Promise<void> {
this.addTelemetry(TelemetryKeys.RunQueryString, ownerUri);
this.addTelemetry(TelemetryKeys.TelemetryAction.RunQueryString, ownerUri);
return this._runAction(ownerUri, (runner) => {
return runner.runQueryString(ownerUri, queryString);
});

View File

@@ -78,7 +78,7 @@ export class FirewallRuleDialog extends Modal {
) {
super(
localize('createNewFirewallRule', "Create new firewall rule"),
TelemetryKeys.FireWallRule,
TelemetryKeys.ModalDialogName.FireWallRule,
telemetryService,
layoutService,
clipboardService,

View File

@@ -46,7 +46,7 @@ export class ResourceProviderService implements IResourceProviderService {
return new Promise<azdata.CreateFirewallRuleResponse>((resolve, reject) => {
const provider = this._providers[resourceProviderId];
if (provider) {
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.FirewallRuleRequested)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.FirewallRuleRequested)
.withAdditionalProperties({
provider: resourceProviderId
}).send();

View File

@@ -142,7 +142,7 @@ export class RestoreDialog extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(localize('RestoreDialogTitle', "Restore database"), TelemetryKeys.Restore, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { hasErrors: true, width: 'wide', hasSpinner: true });
super(localize('RestoreDialogTitle', "Restore database"), TelemetryKeys.ModalDialogName.Restore, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { hasErrors: true, width: 'wide', hasSpinner: true });
// view model
this.viewModel = new RestoreViewModel(optionsMetadata);

View File

@@ -60,7 +60,7 @@ export class RestoreService implements IRestoreService {
return new Promise<azdata.RestoreResponse>((resolve, reject) => {
const providerResult = this.getProvider(connectionUri);
if (providerResult) {
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.RestoreRequested)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.RestoreRequested)
.withAdditionalProperties({
provider: providerResult.providerName
}).send();

View File

@@ -72,7 +72,7 @@ export class ServerGroupDialog extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(localize('ServerGroupsDialogTitle', "Server Groups"), TelemetryKeys.ServerGroups, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
super(localize('ServerGroupsDialogTitle', "Server Groups"), TelemetryKeys.ModalDialogName.ServerGroups, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
}
public render() {