Skip to content

Report telemetry data from the project generation wizard.#437

Merged
rgrunber merged 1 commit intoredhat-developer:masterfrom
rgrunber:proj-wiz-telemetry
Feb 14, 2022
Merged

Report telemetry data from the project generation wizard.#437
rgrunber merged 1 commit intoredhat-developer:masterfrom
rgrunber:proj-wiz-telemetry

Conversation

@rgrunber
Copy link
Copy Markdown
Member

@rgrunber rgrunber commented Jan 14, 2022

The project generation wizard has some cases where the vscode.openFolder command may be called. In those cases, the extension is shut down / disposed and the command never returns, so we aren't actually reporting this type of telemetry in certain cases! This means we can't do telemetry in the registerCommandWithTelemetry wrapper, and should do it just before the open folder logic.

Also, I'm not yet sure why, but having deactivate() return an empty Promise, restores the shutdown telemetry events for me, where before none were reported. Interestingly, the last reporting of a shutdown event for me happened on Dec 8th with VS Code 1.62.3. 1.63.0 was released the same day so it looks like the update might have changed something.

Signed-off-by: Roland Grunberg rgrunber@redhat.com

Comment thread src/extension.ts Outdated
Comment thread src/wizards/generateProject/generationWizard.ts Outdated

const projectGenState: ProjectGenState = state as ProjectGenState;
await sendTelemetry(VSCodeCommands.CREATE_PROJECT, {
status: CMD_SUCCEED_VALUE,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status is set as succeeded even before we perform the actual project creation. So we'll never see any failure

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I think I can create a separate helper that does the vscode.openFolder and reports the telemetry right before that. That should ensure we still report failure if something happens in the download/extraction of the project.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fbricon I've updated the PR to perform the telemetry reporting just before openProject(..) is called. There's just one issue :

If starting with a workspace that has no folders opened, and generating a Quarkus project from that, it still doesn't report the telemetry. I'm using sendTelemetry(...).then(() => openProject(projectDir)); . I can see :

vscode-redhat-telemetry: Event received: quarkusTools.createProject
vscode-redhat-telemetry: Sending 'track' event with
{"userId":"...","event":"quarkusTools.createProject","properties":{"status":"succeeded","buildTool":"Maven","shouldGenerateCode":true,"extensions":"io.quarkus:quarkus-agroal,io.quarkiverse.amazonservices:quarkus-amazon-dynamodb,io.quarkiverse.amazonservices:quarkus-amazon-iam","extension_name":"redhat.vscode-quarkus","extension_version":"1.9.1","app_name":"Visual Studio Code","app_version":"1.63.2","app_kind":"Desktop","app_remote":false}...}

in the debug log, but the event never ends up recorded. Is there some part of the telemetry reporting that doesn't finish immediately and would get interrupted by the eventual vscode.openFolder call ?

- Fixes redhat-developer#405
- Add boolean option to registerCommandWithTelemetry that delegates
  telemetry reporting to the command
- perform telemetry directly in the project generation wizard.

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
@rgrunber
Copy link
Copy Markdown
Member Author

I think I'll merge this in for the upcoming release. There's a case where telemetry doesn't seem to be sent, but it's better to report some/most amounts than nothing at all.

@rgrunber rgrunber merged commit 1242b34 into redhat-developer:master Feb 14, 2022
@rgrunber rgrunber deleted the proj-wiz-telemetry branch February 14, 2022 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide more granularity for the create project event

2 participants