Support proxies in the telemetry service (#187952)

This commit is contained in:
Logan Ramos
2023-07-14 11:53:47 -07:00
committed by GitHub
parent 5eb82ae6c4
commit ef42b49e80
5 changed files with 84 additions and 22 deletions
+3 -2
View File
@@ -192,7 +192,8 @@ class CliMain extends Disposable {
services.set(IUriIdentityService, new UriIdentityService(fileService));
// Request
services.set(IRequestService, new SyncDescriptor(RequestService, undefined, true));
const requestService = new RequestService(configurationService, environmentService, logService, loggerService);
services.set(IRequestService, requestService);
// Download Service
services.set(IDownloadService, new SyncDescriptor(DownloadService, undefined, true));
@@ -212,7 +213,7 @@ class CliMain extends Disposable {
const isInternal = isInternalTelemetry(productService, configurationService);
if (supportsTelemetry(productService, environmentService)) {
if (productService.aiConfig && productService.aiConfig.ariaKey) {
appenders.push(new OneDataSystemAppender(isInternal, 'monacoworkbench', null, productService.aiConfig.ariaKey));
appenders.push(new OneDataSystemAppender(requestService, isInternal, 'monacoworkbench', null, productService.aiConfig.ariaKey));
}
const config: ITelemetryServiceConfig = {
@@ -251,7 +251,8 @@ class SharedProcessMain extends Disposable {
services.set(IUriIdentityService, uriIdentityService);
// Request
services.set(IRequestService, new RequestChannelClient(mainProcessService.getChannel('request')));
const requestService = new RequestChannelClient(mainProcessService.getChannel('request'));
services.set(IRequestService, requestService);
// Checksum
services.set(IChecksumService, new SyncDescriptor(ChecksumService, undefined, false /* proxied to other processes */));
@@ -279,7 +280,7 @@ class SharedProcessMain extends Disposable {
const logAppender = new TelemetryLogAppender(logService, loggerService, environmentService, productService);
appenders.push(logAppender);
if (productService.aiConfig?.ariaKey) {
const collectorAppender = new OneDataSystemAppender(internalTelemetry, 'monacoworkbench', null, productService.aiConfig.ariaKey);
const collectorAppender = new OneDataSystemAppender(requestService, internalTelemetry, 'monacoworkbench', null, productService.aiConfig.ariaKey);
this._register(toDisposable(() => collectorAppender.flush())); // Ensure the 1DS appender is disposed so that it flushes remaining data
appenders.push(collectorAppender);
}