Clean up telemetry keys (#14093)

This commit is contained in:
Charles Gagnon
2021-01-28 13:33:12 -08:00
committed by GitHub
parent c16aee760f
commit c3a00c2cc6
10 changed files with 62 additions and 63 deletions

View File

@@ -378,7 +378,7 @@ export abstract class Modal extends Disposable implements IThemable {
}));
this.layout(DOM.getTotalHeight(this._modalBodySection!));
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ModalDialogOpened)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.ModalDialogOpened)
.withAdditionalProperties({ name: this._name })
.send();
}
@@ -395,7 +395,7 @@ export abstract class Modal extends Disposable implements IThemable {
this._modalShowingContext.get()!.pop();
this._bodyContainer!.remove();
this.disposableStore.clear();
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.ModalDialogClosed)
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.TelemetryAction.ModalDialogClosed)
.withAdditionalProperties({
name: this._name,
reason: reason,

View File

@@ -16,11 +16,11 @@ import { AlertsViewComponent } from 'sql/workbench/contrib/jobManagement/browser
import { OperatorsViewComponent } from 'sql/workbench/contrib/jobManagement/browser/operatorsView.component';
import { ProxiesViewComponent } from 'sql/workbench/contrib/jobManagement/browser/proxiesView.component';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryView, TelemetryAction } from 'sql/platform/telemetry/common/telemetryKeys';
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
import { JobManagementView } from 'sql/workbench/contrib/jobManagement/browser/jobManagementView';
import { NotebooksViewComponent } from 'sql/workbench/contrib/jobManagement/browser/notebooksView.component';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const successLabel: string = nls.localize('jobaction.successLabel', "Success");
export const errorLabel: string = nls.localize('jobaction.faillabel', "Error");
@@ -92,7 +92,7 @@ export class RunJobAction extends Action {
@IErrorMessageService private errorMessageService: IErrorMessageService,
@IJobManagementService private jobManagementService: IJobManagementService,
@IInstantiationService private instantationService: IInstantiationService,
@ITelemetryService private telemetryService: ITelemetryService
@IAdsTelemetryService private telemetryService: IAdsTelemetryService
) {
super(RunJobAction.ID, RunJobAction.LABEL, 'start');
}
@@ -101,7 +101,7 @@ export class RunJobAction extends Action {
let jobName = context.targetObject.job.name;
let ownerUri = context.ownerUri;
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
this.telemetryService.publicLog(TelemetryKeys.RunAgentJob);
this.telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.RunAgentJob);
return new Promise<boolean>((resolve, reject) => {
this.jobManagementService.jobAction(ownerUri, jobName, JobActions.Run).then(async (result) => {
if (result.success) {
@@ -127,7 +127,7 @@ export class StopJobAction extends Action {
@IErrorMessageService private errorMessageService: IErrorMessageService,
@IJobManagementService private jobManagementService: IJobManagementService,
@IInstantiationService private instantationService: IInstantiationService,
@ITelemetryService private telemetryService: ITelemetryService
@IAdsTelemetryService private telemetryService: IAdsTelemetryService
) {
super(StopJobAction.ID, StopJobAction.LABEL, 'stop');
}
@@ -136,7 +136,7 @@ export class StopJobAction extends Action {
let jobName = context.targetObject.name;
let ownerUri = context.ownerUri;
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
this.telemetryService.publicLog(TelemetryKeys.StopAgentJob);
this.telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.StopAgentJob);
return new Promise<boolean>((resolve, reject) => {
this.jobManagementService.jobAction(ownerUri, jobName, JobActions.Stop).then(async (result) => {
if (result.success) {
@@ -194,7 +194,7 @@ export class DeleteJobAction extends Action {
@INotificationService private _notificationService: INotificationService,
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IJobManagementService private _jobService: IJobManagementService,
@ITelemetryService private _telemetryService: ITelemetryService
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
) {
super(DeleteJobAction.ID, DeleteJobAction.LABEL);
}
@@ -208,7 +208,7 @@ export class DeleteJobAction extends Action {
[{
label: DeleteJobAction.LABEL,
run: () => {
this._telemetryService.publicLog(TelemetryKeys.DeleteAgentJob);
this._telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.DeleteAgentJob);
self._jobService.deleteJob(actionInfo.ownerUri, actionInfo.targetObject.job).then(result => {
if (!result || !result.success) {
let errorMessage = nls.localize("jobaction.failedToDeleteJob", "Could not delete job '{0}'.\nError: {1}",
@@ -260,7 +260,7 @@ export class DeleteStepAction extends Action {
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IJobManagementService private _jobService: IJobManagementService,
@IInstantiationService private instantationService: IInstantiationService,
@ITelemetryService private _telemetryService: ITelemetryService
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
) {
super(DeleteStepAction.ID, DeleteStepAction.LABEL);
}
@@ -275,7 +275,7 @@ export class DeleteStepAction extends Action {
[{
label: DeleteStepAction.LABEL,
run: () => {
this._telemetryService.publicLog(TelemetryKeys.DeleteAgentJobStep);
this._telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.DeleteAgentJobStep);
self._jobService.deleteJobStep(actionInfo.ownerUri, actionInfo.targetObject).then(async (result) => {
if (!result || !result.success) {
let errorMessage = nls.localize('jobaction.failedToDeleteStep', "Could not delete step '{0}'.\nError: {1}",
@@ -350,7 +350,7 @@ export class DeleteAlertAction extends Action {
@INotificationService private _notificationService: INotificationService,
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IJobManagementService private _jobService: IJobManagementService,
@ITelemetryService private _telemetryService: ITelemetryService
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
) {
super(DeleteAlertAction.ID, DeleteAlertAction.LABEL);
}
@@ -364,7 +364,7 @@ export class DeleteAlertAction extends Action {
[{
label: DeleteAlertAction.LABEL,
run: () => {
this._telemetryService.publicLog(TelemetryKeys.DeleteAgentAlert);
self._telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.DeleteAgentAlert);
self._jobService.deleteAlert(actionInfo.ownerUri, alert).then(result => {
if (!result || !result.success) {
let errorMessage = nls.localize("jobaction.failedToDeleteAlert", "Could not delete alert '{0}'.\nError: {1}",
@@ -436,7 +436,7 @@ export class DeleteOperatorAction extends Action {
@INotificationService private _notificationService: INotificationService,
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IJobManagementService private _jobService: IJobManagementService,
@ITelemetryService private _telemetryService: ITelemetryService
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
) {
super(DeleteOperatorAction.ID, DeleteOperatorAction.LABEL);
}
@@ -450,7 +450,7 @@ export class DeleteOperatorAction extends Action {
[{
label: DeleteOperatorAction.LABEL,
run: () => {
self._telemetryService.publicLog(TelemetryKeys.DeleteAgentOperator);
self._telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.DeleteAgentOperator);
self._jobService.deleteOperator(actionInfo.ownerUri, actionInfo.targetObject).then(result => {
if (!result || !result.success) {
let errorMessage = nls.localize("jobaction.failedToDeleteOperator", "Could not delete operator '{0}'.\nError: {1}",
@@ -531,7 +531,7 @@ export class DeleteProxyAction extends Action {
@INotificationService private _notificationService: INotificationService,
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IJobManagementService private _jobService: IJobManagementService,
@ITelemetryService private _telemetryService: ITelemetryService
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
) {
super(DeleteProxyAction.ID, DeleteProxyAction.LABEL);
}
@@ -545,7 +545,7 @@ export class DeleteProxyAction extends Action {
[{
label: DeleteProxyAction.LABEL,
run: () => {
this._telemetryService.publicLog(TelemetryKeys.DeleteAgentProxy);
self._telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.DeleteAgentProxy);
self._jobService.deleteProxy(actionInfo.ownerUri, actionInfo.targetObject).then(result => {
if (!result || !result.success) {
let errorMessage = nls.localize("jobaction.failedToDeleteProxy", "Could not delete proxy '{0}'.\nError: {1}",
@@ -626,7 +626,7 @@ export class DeleteNotebookAction extends Action {
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IJobManagementService private _jobService: IJobManagementService,
@IInstantiationService private instantationService: IInstantiationService,
@ITelemetryService private _telemetryService: ITelemetryService
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
) {
super(DeleteNotebookAction.ID, DeleteNotebookAction.LABEL);
}
@@ -641,7 +641,7 @@ export class DeleteNotebookAction extends Action {
[{
label: DeleteNotebookAction.LABEL,
run: () => {
this._telemetryService.publicLog(TelemetryKeys.DeleteAgentJob);
self._telemetryService.sendActionEvent(TelemetryView.Agent, TelemetryAction.DeleteAgentJob);
self._jobService.deleteNotebook(actionInfo.ownerUri, actionInfo.targetObject.job).then(async (result) => {
if (!result || !result.success) {
await refreshAction.run(actionInfo);

View File

@@ -31,8 +31,8 @@ import { JobManagementView, JobActionContext } from 'sql/workbench/contrib/jobMa
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const DASHBOARD_SELECTOR: string = 'jobhistory-component';
@@ -83,7 +83,7 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
@Inject(IKeybindingService) keybindingService: IKeybindingService,
@Inject(IDashboardService) dashboardService: IDashboardService,
@Inject(ITelemetryService) private _telemetryService: ITelemetryService
@Inject(IAdsTelemetryService) private _telemetryService: IAdsTelemetryService
) {
super(commonService, dashboardService, contextMenuService, keybindingService, instantiationService, _agentViewComponent);
this._treeController = new JobHistoryController();
@@ -148,7 +148,7 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
}, { verticalScrollMode: ScrollbarVisibility.Visible });
this._register(attachListStyler(this._tree, this.themeService));
this._tree.layout(dom.getContentHeight(this._tableContainer.nativeElement));
this._telemetryService.publicLog(TelemetryKeys.JobHistoryView);
this._telemetryService.sendViewEvent(TelemetryView.AgentJobHistory);
}
private loadHistory() {

View File

@@ -23,9 +23,9 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { IJobManagementService } from 'sql/workbench/services/jobManagement/common/interfaces';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const JOBSTEPSVIEW_SELECTOR: string = 'jobstepsview-component';
@@ -53,7 +53,7 @@ export class JobStepsViewComponent extends JobManagementView implements OnInit,
@Inject(IContextMenuService) contextMenuService: IContextMenuService,
@Inject(IKeybindingService) keybindingService: IKeybindingService,
@Inject(IDashboardService) dashboardService: IDashboardService,
@Inject(ITelemetryService) private _telemetryService: ITelemetryService
@Inject(IAdsTelemetryService) private _telemetryService: IAdsTelemetryService
) {
super(commonService, dashboardService, contextMenuService, keybindingService, instantiationService, undefined);
}
@@ -111,7 +111,7 @@ export class JobStepsViewComponent extends JobManagementView implements OnInit,
this._treeDataSource.data = data;
await this._tree.refresh();
});
this._telemetryService.publicLog(TelemetryKeys.JobStepsView);
this._telemetryService.sendViewEvent(TelemetryView.AgentJobSteps);
}
public onFirstVisible() {

View File

@@ -29,11 +29,11 @@ import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardServi
import { escape } from 'sql/base/common/strings';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { tableBackground, cellBackground, cellBorderColor } from 'sql/platform/theme/common/colors';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
import { onUnexpectedError } from 'vs/base/common/errors';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const JOBSVIEW_SELECTOR: string = 'jobsview-component';
export const ROW_HEIGHT: number = 45;
@@ -107,7 +107,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
@Inject(IContextMenuService) contextMenuService: IContextMenuService,
@Inject(IKeybindingService) keybindingService: IKeybindingService,
@Inject(IDashboardService) _dashboardService: IDashboardService,
@Inject(ITelemetryService) private _telemetryService: ITelemetryService
@Inject(IAdsTelemetryService) private _telemetryService: IAdsTelemetryService
) {
super(commonService, _dashboardService, contextMenuService, keybindingService, instantiationService, _agentViewComponent);
let jobCacheObjectMap = this._jobManagementService.jobCacheObjectMap;
@@ -127,7 +127,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
this._visibilityElement = this._gridEl;
this._parentComponent = this._agentViewComponent;
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
this._telemetryService.publicLog(TelemetryKeys.JobsView);
this._telemetryService.sendViewEvent(TelemetryView.AgentJobs);
}
ngOnDestroy() {

View File

@@ -24,9 +24,9 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const DASHBOARD_SELECTOR: string = 'notebookhistory-component';
export class GridSection {
@@ -82,7 +82,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
@Inject(ICommandService) private _commandService: ICommandService,
@Inject(IKeybindingService) keybindingService: IKeybindingService,
@Inject(IDashboardService) dashboardService: IDashboardService,
@Inject(ITelemetryService) private _telemetryService: ITelemetryService,
@Inject(IAdsTelemetryService) private _telemetryService: IAdsTelemetryService,
@Inject(IQuickInputService) private _quickInputService: IQuickInputService
) {
super(commonService, dashboardService, contextMenuService, keybindingService, instantiationService, _agentViewComponent);
@@ -104,7 +104,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
this._parentComponent = this._agentViewComponent;
this._agentNotebookInfo = this._agentViewComponent.agentNotebookInfo;
this.initActionBar();
this._telemetryService.publicLog(TelemetryKeys.JobHistoryView);
this._telemetryService.sendViewEvent(TelemetryView.AgentNotebookHistory);
}
private loadHistory() {

View File

@@ -29,12 +29,12 @@ import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardServi
import { escape } from 'sql/base/common/strings';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { tableBackground, cellBackground, cellBorderColor } from 'sql/platform/theme/common/colors';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
import { onUnexpectedError } from 'vs/base/common/errors';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const NOTEBOOKSVIEW_SELECTOR: string = 'notebooksview-component';
@@ -106,7 +106,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
@Inject(IContextMenuService) contextMenuService: IContextMenuService,
@Inject(IKeybindingService) keybindingService: IKeybindingService,
@Inject(IDashboardService) _dashboardService: IDashboardService,
@Inject(ITelemetryService) private _telemetryService: ITelemetryService
@Inject(IAdsTelemetryService) private _telemetryService: IAdsTelemetryService
) {
super(commonService, _dashboardService, contextMenuService, keybindingService, instantiationService, _agentViewComponent);
let notebookCacheObjectMap = this._jobManagementService.notebookCacheObjectMap;
@@ -126,7 +126,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
this._visibilityElement = this._gridEl;
this._parentComponent = this._agentViewComponent;
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
this._telemetryService.publicLog(TelemetryKeys.JobsView);
this._telemetryService.sendViewEvent(TelemetryView.AgentNotebooks);
}
ngOnDestroy() {

View File

@@ -10,7 +10,7 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Disposable } from 'vs/base/common/lifecycle';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ICommandService, ICommandEvent } from 'vs/platform/commands/common/commands';
import { TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
import { TelemetryAction, TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys';
export class SqlTelemetryContribution extends Disposable implements IWorkbenchContribution {
@@ -35,7 +35,7 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo
// Events from src\vs\editor\contrib\wordOperations\wordOperations.ts
!e.commandId.startsWith('cursor') &&
!e.commandId.startsWith('_vscode_delegate')) {
telemetryService.sendActionEvent(TelemetryView.Shell, 'adsCommandExecuted', e.commandId);
telemetryService.sendActionEvent(TelemetryView.Shell, TelemetryAction.adsCommandExecuted, e.commandId);
}
}));
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import 'vs/css!./media/dialogModal';
import { Modal, IModalOptions } from 'sql/workbench/browser/modal/modal';
import { Wizard, DialogButton, WizardPage } from 'sql/workbench/services/dialog/common/dialogTypes';
@@ -28,6 +27,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { status } from 'vs/base/browser/ui/aria/aria';
import { TelemetryView, TelemetryAction } from 'sql/platform/telemetry/common/telemetryKeys';
export class WizardModal extends Modal {
private _dialogPanes = new Map<WizardPage, DialogPane>();
@@ -213,7 +213,7 @@ export class WizardModal extends Modal {
});
if (index !== prevPageIndex) {
this._telemetryEventService.createActionEvent(TelemetryKeys.TelemetryView.Shell, TelemetryKeys.WizardPagesNavigation)
this._telemetryEventService.createActionEvent(TelemetryView.Shell, TelemetryAction.WizardPagesNavigation)
.withAdditionalProperties({
wizardName: this._wizard.name,
pageNavigationFrom: this._wizard.pages[prevPageIndex].pageName ?? prevPageIndex,