mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Notebook Telemetry initial changes (#13929)
* initial changes * add ads-telemetry to nb extension * add aiKey to notebook extension * add run cell telemetry in cellmodel * add NbTelemetryAction * remove source * remove telemtery for run notebook for now * fix optional variable call * addr comments * changing the dependency package * revert * removed webpack config for telemetry compat * add opentelemetry to externals Co-authored-by: Benjin Dubishar <benjin.dubishar@gmail.com>
This commit is contained in:
@@ -28,6 +28,8 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { tryMatchCellMagic, extractCellMagicCommandPlusArgs } from 'sql/workbench/services/notebook/browser/utils';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
|
||||
let modelId = 0;
|
||||
const ads_execute_command = 'ads_execute_command';
|
||||
@@ -83,7 +85,8 @@ export class CellModel extends Disposable implements ICellModel {
|
||||
private _options: ICellModelOptions,
|
||||
@optional(INotebookService) private _notebookService?: INotebookService,
|
||||
@optional(ICommandService) private _commandService?: ICommandService,
|
||||
@optional(IConfigurationService) private _configurationService?: IConfigurationService
|
||||
@optional(IConfigurationService) private _configurationService?: IConfigurationService,
|
||||
@optional(IAdsTelemetryService) private _telemetryService?: IAdsTelemetryService,
|
||||
) {
|
||||
super();
|
||||
this.id = `${modelId++}`;
|
||||
@@ -483,6 +486,9 @@ export class CellModel extends Disposable implements ICellModel {
|
||||
if (!kernel) {
|
||||
return false;
|
||||
}
|
||||
this._telemetryService?.createActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.RunCell)
|
||||
.withAdditionalProperties({ cell_language: kernel.name })
|
||||
.send();
|
||||
// If cell is currently running and user clicks the stop/cancel button, call kernel.interrupt()
|
||||
// This matches the same behavior as JupyterLab
|
||||
if (this.future && this.future.inProgress) {
|
||||
|
||||
Reference in New Issue
Block a user