Skip to content

Commit 9765315

Browse files
committed
Flush telemetry appender on dispose
1 parent 2633bca commit 9765315

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

patches/telemetry.diff

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
2020
import { NullPolicyService } from 'vs/platform/policy/common/policy';
2121
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
2222
import { LoggerService } from 'vs/platform/log/node/loggerService';
23-
@@ -146,10 +147,25 @@ export async function setupServerService
23+
@@ -146,11 +147,23 @@ export async function setupServerService
2424
const requestService = new RequestService(configurationService, environmentService, logService, loggerService);
2525
services.set(IRequestService, requestService);
2626

@@ -40,13 +40,12 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
4040
const isInternal = isInternalTelemetry(productService, configurationService);
4141
if (supportsTelemetry(productService, environmentService)) {
4242
- if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
43-
+ const telemetryEndpoint = productService.telemetryEndpoint;
44-
+ if (telemetryEndpoint) {
45-
+ oneDsAppender = new OneDataSystemAppender(requestService, false, eventPrefix, null, () => new TelemetryClient(telemetryEndpoint, isContainer));
46-
+ } else if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
47-
oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
43+
- oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
44+
+ if (!isLoggingOnly(productService, environmentService) && productService.telemetryEndpoint) {
45+
+ oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, () => new TelemetryClient(productService.telemetryEndpoint!, isContainer));
4846
disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
4947
}
48+
5049
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
5150
===================================================================
5251
--- /dev/null

0 commit comments

Comments
 (0)