Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dashboard/code] Produce timing data for workspace startup #4907

Merged
merged 2 commits into from
Jul 26, 2021

Conversation

csweichel
Copy link
Contributor

@csweichel csweichel commented Jul 22, 2021

This PR produces analytics events from the frontend to track the speed and reliability of workspace starts. E.g.

{"payload":{"userId":"1c23ee48-4c56-4684-831e-cca71711a36b","event":"workspace-started","properties":{"workspaceId":"brown-leopon-tndxsxj3","instanceId":"7ed1f664-8af1-4ea0-8f4a-10178f925a79","contextURL":"https://github.com/gitpod-io/template-typescript-node","usesPrebuild":false}},"component":"server","severity":"DEBUG","time":"2021-07-22T09:30:16.571Z","environment":"devstaging","region":"europe-west1","message":"analytics track"}
{"payload":{"userId":"1c23ee48-4c56-4684-831e-cca71711a36b","event":"status_rendered","properties":{"workspaceId":"brown-leopon-tndxsxj3","phase":"creating"}},"component":"server","severity":"DEBUG","time":"2021-07-22T09:30:17.901Z","environment":"devstaging","region":"europe-west1","message":"analytics track"}
{"payload":{"userId":"1c23ee48-4c56-4684-831e-cca71711a36b","event":"status_rendered","properties":{"workspaceId":"brown-leopon-tndxsxj3","phase":"initializing"}},"component":"server","severity":"DEBUG","time":"2021-07-22T09:30:29.593Z","environment":"devstaging","region":"europe-west1","message":"analytics track"}
{"payload":{"userId":"1c23ee48-4c56-4684-831e-cca71711a36b","event":"status_rendered","properties":{"workspaceId":"brown-leopon-tndxsxj3","phase":"running"}},"component":"server","severity":"DEBUG","time":"2021-07-22T09:30:40.577Z","environment":"devstaging","region":"europe-west1","message":"analytics track"}
{"payload":{"userId":"1c23ee48-4c56-4684-831e-cca71711a36b","event":"status_rendered","properties":{"workspaceId":"brown-leopon-tndxsxj3","phase":"vsc_opened"}},"component":"server","severity":"DEBUG","time":"2021-07-22T09:30:45.054Z","environment":"devstaging","region":"europe-west1","message":"analytics track"}

Corresponding code PR: gitpod-io/openvscode-server#21
@akosyakov what's the usual path here? Merge the PR in vscode and then update the commit in this one?

Caveat: we'll possibly receive multiple vsc_opened events, namely whenever the user opens the IDE, e.g. reloads the window or opens another one.

fixes #4863

/werft analytics=log

@csweichel csweichel requested review from akosyakov, jakobhero and AlexTugarev and removed request for jankeromnes, AlexTugarev and rl-gitpod July 22, 2021 09:37
@csweichel csweichel force-pushed the csweichel/enhancement-more-insight-4863 branch from 010180b to 6a09826 Compare July 22, 2021 09:39
@csweichel
Copy link
Contributor Author

/hold

@akosyakov I want to make sure you get a chance to have a look at this change. Hence I'm holding the merge.

@akosyakov
Copy link
Member

akosyakov commented Jul 23, 2021

@akosyakov what's the usual path here? Merge the PR in vscode and then update the commit in this one?

Usually yes, but we did not merge yet #4807 which points to gp-code. Main state sits in https://github.com/gitpod-io/vscode/tree/gp-code-1.57.1

Updated It was merged, but please see comments below.

@akosyakov
Copy link
Member

I think you can do it in the supervisor instead of VS Code:

ideService.onDidChange(() => {

If ideService.state is ready, it means that IDE was rendered.

@akosyakov
Copy link
Member

akosyakov commented Jul 23, 2021

Could we also capture a reason why starting IDE failed? There is another state on ideServices.failureCause, at least it should work if there are not any uncaptured async errors.

@jakobhero
Copy link
Contributor

jakobhero commented Jul 23, 2021

/werft run

👍 started the job as gitpod-build-csweichel-enhancement-more-insight-4863.3

@csweichel
Copy link
Contributor Author

@akosyakov thank you for the feedback. I'll move the write to the supervisor frontend, and also capture the failure reason.

@csweichel csweichel force-pushed the csweichel/enhancement-more-insight-4863 branch from 6a09826 to 6bbf476 Compare July 23, 2021 11:17
@csweichel
Copy link
Contributor Author

This is how the happy path looks like now:

image

properties: {
workspaceId: gitpodServiceClient.info.latestInstance?.workspaceId,
phase: `ide-${ideService.state}`,
error: ideService.failureCause?.message,
Copy link
Member

Choose a reason for hiding this comment

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

there is also can be ideService.failureCause?.stack it would be interesting to capture it

@AlexTugarev
Copy link
Member

AlexTugarev commented Jul 26, 2021

/werft run

👍 started the job as gitpod-build-csweichel-enhancement-more-insight-4863.5

@csweichel
Copy link
Contributor Author

/hold cancel

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 080c71bce25fb16fe4695f25f9864f048b1fe5c2

@AlexTugarev
Copy link
Member

/lgtm

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexTugarev, csweichel, jakobhero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 89db73e into main Jul 26, 2021
@roboquat roboquat deleted the csweichel/enhancement-more-insight-4863 branch July 26, 2021 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[enhancement] More insight into the UX-perspective on workspace startup
5 participants