Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/telemetry/telemetryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export class TelemetryService {
}

public getCommonProperties(): Record<string, string | undefined> {
return { extension_version: `${version}`, device_id: this.deviceId };
return {
extension_version: `${version}`,
device_id: this.deviceId,
app_name: vscode.env.appName, // e.g., "Visual Studio Code" or "Azure Data Studio"
Copy link
Contributor

Choose a reason for hiding this comment

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

could this be undefined? we should fallback to Visual Studio Code - Unknown or something like that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell, this should never be undefiend, but even if it is, is that an issue for the telemetry consumers?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, just makes it more intentional / easier for us to track what scenario happened

};
}

private async readSegmentKey(): Promise<string | undefined> {
Expand Down Expand Up @@ -105,6 +109,7 @@ export class TelemetryService {
anonymousId: this.anonymousId,
traits: {
device_id: this.deviceId,
app_name: vscode.env.appName, // e.g., "Visual Studio Code" or "Azure Data Studio"
},
};

Expand Down
1 change: 1 addition & 0 deletions src/test/suite/telemetry/telemetryService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ suite('Telemetry Controller Test Suite', () => {
const commonProperties = {
extension_version: version,
device_id: testDeviceId,
app_name: vscode.env.appName,
};

const sandbox = sinon.createSandbox();
Expand Down