From dc34b949d05688e67f06a6d4d860cc09986430ef Mon Sep 17 00:00:00 2001 From: Christian Weichel Date: Thu, 22 Jul 2021 08:51:31 +0000 Subject: [PATCH 1/2] [dashboard] Track rendered phases --- .../dashboard/src/start/StartWorkspace.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/components/dashboard/src/start/StartWorkspace.tsx b/components/dashboard/src/start/StartWorkspace.tsx index f5e47bca0e5e13..114e2bfed3e714 100644 --- a/components/dashboard/src/start/StartWorkspace.tsx +++ b/components/dashboard/src/start/StartWorkspace.tsx @@ -65,6 +65,24 @@ export default class StartWorkspace extends React.Component Date: Thu, 22 Jul 2021 08:52:34 +0000 Subject: [PATCH 2/2] [code] Track vsc_opened when IDE is open --- components/server/src/workspace/workspace-starter.ts | 1 + components/supervisor/frontend/src/index.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index 09d127f229edc1..87c048ed9c0e46 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -691,6 +691,7 @@ export class WorkspaceStarter { "function:getEnvVars", "function:setEnvVar", "function:deleteEnvVar", + "function:trackEvent", "resource:"+ScopedResourceGuard.marshalResourceScope({kind: "workspace", subjectID: workspace.id, operations: ["get", "update"]}), "resource:"+ScopedResourceGuard.marshalResourceScope({kind: "workspaceInstance", subjectID: instance.id, operations: ["get", "update", "delete"]}), diff --git a/components/supervisor/frontend/src/index.ts b/components/supervisor/frontend/src/index.ts index ae55e0172f77c7..08d913a0295bef 100644 --- a/components/supervisor/frontend/src/index.ts +++ b/components/supervisor/frontend/src/index.ts @@ -137,6 +137,15 @@ const loadingIDE = new Promise(resolve => window.addEventListener('DOMContentLoa ideService.onDidChange(() => { updateLoadingState(); updateCurrentFrame(); + + window.gitpod.service.server.trackEvent({ + event: "status_rendered", + properties: { + workspaceId: gitpodServiceClient.info.latestInstance?.workspaceId, + phase: `ide-${ideService.state}`, + error: ideService.failureCause?.message, + }, + }); }); //#endregion