@@ -104,6 +104,13 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
104
104
- sendErrorTelemetry: this.sendErrorTelemetry,
105
105
- };
106
106
- this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
107
+ -
108
+ - if (getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
109
+ - // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
110
+ - // This is most likely due to ad blockers
111
+ - fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => {
112
+ - this.impl = NullTelemetryService;
113
+ - });
107
114
+ const telemetryProvider: ITelemetryAppender | undefined = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : productService.aiConfig?.ariaKey ? new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey) : undefined;
108
115
+ if (telemetryProvider) {
109
116
+ appenders.push(telemetryProvider);
@@ -114,13 +121,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
114
121
+ sendErrorTelemetry: this.sendErrorTelemetry,
115
122
+ };
116
123
+ this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
117
-
118
- - if (getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
119
- - // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
120
- - // This is most likely due to ad blockers
121
- - fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => {
122
- - this.impl = NullTelemetryService;
123
- - });
124
+ +
124
125
+ if (remoteAgentService.getConnection() === null && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
125
126
+ // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
126
127
+ // This is most likely due to ad blockers
0 commit comments