Skip to content

Commit 2633bca

Browse files
committed
Move telemetry endpoint to product service
This will let us use it in the client.
1 parent 125a972 commit 2633bca

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

patches/display-language.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
3030
import { ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net';
3131
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
3232
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
33-
@@ -239,6 +239,9 @@ export async function setupServerService
33+
@@ -240,6 +240,9 @@ export async function setupServerService
3434
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
3535
socketServer.registerChannel('extensions', channel);
3636

@@ -220,7 +220,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
220220
import { CharCode } from 'vs/base/common/charCode';
221221
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
222222

223-
@@ -347,6 +348,8 @@ export class WebClientServer {
223+
@@ -348,6 +349,8 @@ export class WebClientServer {
224224
callbackRoute: this._callbackRoute
225225
};
226226

@@ -229,7 +229,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
229229
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
230230
const values: { [key: string]: string } = {
231231
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
232-
@@ -355,6 +358,7 @@ export class WebClientServer {
232+
@@ -356,6 +359,7 @@ export class WebClientServer {
233233
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
234234
BASE: base,
235235
VS_BASE: vscodeBase,

patches/getting-started.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
201201
===================================================================
202202
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
203203
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
204-
@@ -338,6 +338,7 @@ export class WebClientServer {
204+
@@ -339,6 +339,7 @@ export class WebClientServer {
205205
userDataPath: this._environmentService.userDataPath,
206206
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
207207
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],

patches/telemetry.diff

+29-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ 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 = process.env.CS_TELEMETRY_URL || "https://v1.telemetry.coder.com/track";
43+
+ const telemetryEndpoint = productService.telemetryEndpoint;
4444
+ if (telemetryEndpoint) {
4545
+ oneDsAppender = new OneDataSystemAppender(requestService, false, eventPrefix, null, () => new TelemetryClient(telemetryEndpoint, isContainer));
4646
+ } else if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
@@ -109,11 +109,38 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
109109
===================================================================
110110
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
111111
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
112-
@@ -318,6 +318,7 @@ export class WebClientServer {
112+
@@ -318,6 +318,8 @@ export class WebClientServer {
113113
scope: vscodeBase + '/',
114114
path: base + '/_static/out/browser/serviceWorker.js',
115115
},
116116
+ enableTelemetry: this._productService.enableTelemetry,
117+
+ telemetryEndpoint: this._productService.telemetryEndpoint,
117118
embedderIdentifier: 'server-distro',
118119
extensionsGallery: this._productService.extensionsGallery,
119120
};
121+
Index: code-server/lib/vscode/src/vs/base/common/product.ts
122+
===================================================================
123+
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
124+
+++ code-server/lib/vscode/src/vs/base/common/product.ts
125+
@@ -64,6 +64,7 @@ export interface IProductConfiguration {
126+
readonly path: string;
127+
readonly scope: string;
128+
}
129+
+ readonly telemetryEndpoint?: string
130+
131+
readonly version: string;
132+
readonly date?: string;
133+
Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
134+
===================================================================
135+
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
136+
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
137+
@@ -55,7 +55,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
138+
resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
139+
controlUrl: "",
140+
recommendationsUrl: "",
141+
- })
142+
+ }),
143+
+ telemetryEndpoint: env.CS_TELEMETRY_URL || product.telemetryEndpoint || "https://v1.telemetry.coder.com/track",
144+
});
145+
}
146+

0 commit comments

Comments
 (0)