Add telemetry for notebook toolbar actions (#19750)

* add telemetry for notebook toolbar actions

* fix tests

* remove events with no metadata + connection info

* add optional connectioninfo param

* fix param
This commit is contained in:
Lucy Zhang
2022-06-23 05:57:17 -07:00
committed by GitHub
parent 871ac80647
commit 23feac100a
4 changed files with 30 additions and 18 deletions

View File

@@ -362,6 +362,9 @@ export class TrustedAction extends ToggleableAction {
public override async run(context: URI): Promise<void> {
const editor = this._notebookService.findNotebookEditor(context);
this.trusted = !this.trusted;
editor.model.sendNotebookTelemetryActionEvent(TelemetryKeys.NbTelemetryAction.TrustChanged, {
trust: this.trusted
});
editor.model.trustedMode = this.trusted;
}
}
@@ -472,6 +475,9 @@ export class RunParametersAction extends TooltipFromLabelAction {
});
return;
}
editor.model.sendNotebookTelemetryActionEvent(TelemetryKeys.NbTelemetryAction.RunWithParameters, {
kernel: editor.model.languageInfo.name
});
// Set defaultParameters to the parameter values in parameter cell
let defaultParameters = new Map<string, string>();
for (let cell of editor?.cells) {