Skip to content

Commit cd9ae51

Browse files
authored
chore: Add running environment to telemetry VSCODE-352 (#1181)
1 parent 1625fa7 commit cd9ae51

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/telemetry/telemetryService.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export class TelemetryService {
6262
}
6363

6464
public getCommonProperties(): Record<string, string | undefined> {
65-
return { extension_version: `${version}`, device_id: this.deviceId };
65+
return {
66+
extension_version: `${version}`,
67+
device_id: this.deviceId,
68+
app_name: vscode.env.appName || 'Visual Studio Code - Unknown', // e.g., "VS Code" or "Azure Data Studio"
69+
};
6670
}
6771

6872
private async readSegmentKey(): Promise<string | undefined> {
@@ -105,6 +109,7 @@ export class TelemetryService {
105109
anonymousId: this.anonymousId,
106110
traits: {
107111
device_id: this.deviceId,
112+
app_name: vscode.env.appName || 'Visual Studio Code - Unknown', // e.g., "VS Code" or "Azure Data Studio"
108113
},
109114
};
110115

src/test/suite/telemetry/telemetryService.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ suite('Telemetry Controller Test Suite', () => {
4949
const commonProperties = {
5050
extension_version: version,
5151
device_id: testDeviceId,
52+
app_name: vscode.env.appName || 'Visual Studio Code - Unknown',
5253
};
5354

5455
const sandbox = sinon.createSandbox();

0 commit comments

Comments
 (0)