Skip to content

Commit f1989c5

Browse files
author
Sofian Hnaide
committed
add common properties to debug adapter telemetry
1 parent 05c236f commit f1989c5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/vs/workbench/parts/debug/electron-browser/debugService.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import nls = require('vs/nls');
77
import lifecycle = require('vs/base/common/lifecycle');
8+
import Objects = require('vs/base/common/objects');
89
import mime = require('vs/base/common/mime');
910
import ee = require('vs/base/common/eventEmitter');
1011
import uri from 'vs/base/common/uri';
@@ -70,6 +71,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
7071
private lastTaskEvent: TaskEvent;
7172
private toDispose: lifecycle.IDisposable[];
7273
private inDebugMode: IKeybindingContextKey<boolean>;
74+
private telemetryInfo: any;
7375

7476
constructor(
7577
@IStorageService private storageService: IStorageService,
@@ -110,6 +112,12 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
110112
this.viewModel = new viewmodel.ViewModel();
111113

112114
this.registerListeners(eventService, lifecycleService);
115+
116+
this.telemetryInfo = Object.create(null);
117+
this.telemetryService.getTelemetryInfo().then(info => {
118+
this.telemetryInfo['common.vscodemachineid'] = info.machineId;
119+
this.telemetryInfo['common.vscodesessionid'] = info.sessionId;
120+
});
113121
}
114122

115123
private registerListeners(eventService: IEventService, lifecycleService: ILifecycleService): void {
@@ -290,8 +298,8 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
290298
if (!this.telemetryAdapter) {
291299
this.telemetryAdapter = new AIAdapter(key, this.session.getType());
292300
}
293-
294-
this.telemetryAdapter.log(event.body.output, event.body.data);
301+
let data = Objects.mixin(event.body.data, this.telemetryInfo);
302+
this.telemetryAdapter.log(event.body.output, data);
295303
}
296304
} else if (event.body && typeof event.body.output === 'string' && event.body.output.length > 0) {
297305
this.onOutput(event);

0 commit comments

Comments
 (0)