Skip to content

Commit df6c38d

Browse files
authored
Make MPLS and vscode-extension-telemetry work together 🤝 (#11823)
* Revert "Revert vscode-extension-telemetry changes for the release (#11602)" This reverts commit 71d1793. * Remove entry from changelog + add new news entry * Update LS code to use periods instead of slashes * Revert "Update LS code to use periods instead of slashes" This reverts commit 1356651. * Replace slashes before sending telemetry instead * Too fast too furious
1 parent bcac5c1 commit df6c38d

File tree

11 files changed

+189
-244
lines changed

11 files changed

+189
-244
lines changed

gulpfile.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ function getAllowedWarningsForWebPack(buildConfig) {
302302
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/validation.js',
303303
'WARNING in ./node_modules/any-promise/register.js',
304304
'WARNING in ./node_modules/log4js/lib/appenders/index.js',
305-
'WARNING in ./node_modules/log4js/lib/clustering.js'
305+
'WARNING in ./node_modules/log4js/lib/clustering.js',
306+
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
307+
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
306308
];
307309
case 'extension':
308310
return [
@@ -315,10 +317,16 @@ function getAllowedWarningsForWebPack(buildConfig) {
315317
316318
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/buffer-util.js',
317319
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/validation.js',
318-
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/Validation.js'
320+
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/Validation.js',
321+
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
322+
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
319323
];
320324
case 'debugAdapter':
321-
return ['WARNING in ./node_modules/vscode-uri/lib/index.js'];
325+
return [
326+
'WARNING in ./node_modules/vscode-uri/lib/index.js',
327+
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
328+
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
329+
];
322330
default:
323331
throw new Error('Unknown WebPack Configuration');
324332
}

news/3 Code Health/11597.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update telemetry on errors and exceptions to use [vscode-extension-telemetry](https://www.npmjs.com/package/vscode-extension-telemetry).

package-lock.json

Lines changed: 67 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2992,7 +2992,7 @@
29922992
"untildify": "^3.0.2",
29932993
"vscode-debugadapter": "^1.28.0",
29942994
"vscode-debugprotocol": "^1.28.0",
2995-
"vscode-extension-telemetry": "0.1.0",
2995+
"vscode-extension-telemetry": "0.1.4",
29962996
"vscode-jsonrpc": "^5.0.1",
29972997
"vscode-languageclient": "^6.2.0-next.2",
29982998
"vscode-languageserver": "^6.2.0-next.2",

src/client/activation/languageClientMiddleware.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,12 @@ function captureTelemetryForLSPMethod(method: string, debounceMilliseconds: numb
444444
this.lastCaptured.set(method, now);
445445
this.eventCount += 1;
446446

447+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
448+
const formattedMethod = method.replace(/\//g, '.');
449+
447450
const properties = {
448451
lsVersion: this.serverVersion || 'unknown',
449-
method: method
452+
method: formattedMethod
450453
};
451454

452455
const stopWatch = new StopWatch();

src/client/activation/languageServer/languageServerProxy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ export class DotNetLanguageServerProxy implements ILanguageServerProxy {
7373
if (settings.downloadLanguageServer) {
7474
this.languageClient.onTelemetry((telemetryEvent) => {
7575
const eventName = telemetryEvent.EventName || EventName.PYTHON_LANGUAGE_SERVER_TELEMETRY;
76-
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
76+
const formattedProperties = {
77+
...telemetryEvent.Properties,
78+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
79+
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
80+
};
81+
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
7782
});
7883
}
7984
await this.registerTestServices();

src/client/activation/node/languageServerProxy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
9999
if (settings.downloadLanguageServer) {
100100
this.languageClient.onTelemetry((telemetryEvent) => {
101101
const eventName = telemetryEvent.EventName || EventName.LANGUAGE_SERVER_TELEMETRY;
102-
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
102+
const formattedProperties = {
103+
...telemetryEvent.Properties,
104+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
105+
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
106+
};
107+
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
103108
});
104109
}
105110
await this.registerTestServices();

0 commit comments

Comments
 (0)