Skip to content

Commit 6cbcc36

Browse files
committed
Add telemetry for getting started
1 parent 7f3e74b commit 6cbcc36

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

src/vs/gitpod/node/gitpodInsightsAppender.ts

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import * as WebSocket from 'ws';
1919
import { ConsoleLogger, listen as doListen } from 'vscode-ws-jsonrpc';
2020
import * as grpc from '@grpc/grpc-js';
2121
import * as util from 'util';
22-
import { mixin } from 'vs/base/common/objects';
22+
import { filter, mixin } from 'vs/base/common/objects';
2323

2424
class SupervisorConnection {
2525
readonly deadlines = {
@@ -161,9 +161,10 @@ export class GitpodInsightsAppender implements ITelemetryAppender {
161161
this._withAIClient((aiClient) => {
162162
data = mixin(data, this._defaultData);
163163
data = validateTelemetryData(data);
164-
const gitpodTrackEvent = mapTelemetryData(eventName, data.properties);
165-
if (gitpodTrackEvent) {
166-
aiClient.trackEvent(gitpodTrackEvent);
164+
const mappedEvent = mapTelemetryData(eventName, data.properties);
165+
if (mappedEvent) {
166+
mappedEvent.properties = filter(mappedEvent.properties, (_, v) => v !== undefined && v !== null);
167+
aiClient.trackEvent(mappedEvent);
167168
}
168169
});
169170
}
@@ -328,6 +329,33 @@ function mapTelemetryData(eventName: string, data: any): RemoteTrackMessage | un
328329
timestamp: data.timestamp
329330
},
330331
};
332+
case 'gettingStarted.ActionExecuted':
333+
return {
334+
event: 'vscode_getting_started',
335+
properties: {
336+
kind: 'action_executed',
337+
command: data.command,
338+
argument: data.argument,
339+
workspaceId: data.workspaceId,
340+
workspaceInstanceId: data.workspaceInstanceId,
341+
sessionID: data.sessionID,
342+
timestamp: data.timestamp
343+
},
344+
};
345+
case 'editorClosed':
346+
if ((<string>data.typeId) !== 'workbench.editors.gettingStartedInput') {
347+
return undefined;
348+
}
349+
return {
350+
event: 'vscode_getting_started',
351+
properties: {
352+
kind: 'editor_closed',
353+
workspaceId: data.workspaceId,
354+
workspaceInstanceId: data.workspaceInstanceId,
355+
sessionID: data.sessionID,
356+
timestamp: data.timestamp
357+
},
358+
};
331359
}
332360

333361
return undefined;

0 commit comments

Comments
 (0)