Skip to content

Commit 7d59bab

Browse files
authored
Add telemetry on how often server crashes are potentially due to TS service plugins (microsoft#223551)
Add telemetry on how often server crashes are potentially due to TS server plugins Simple flag which tracks if plugins are enabled/disabled
1 parent 4c0c00f commit 7d59bab

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

extensions/typescript-language-features/src/typescriptServiceClient.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,19 +424,22 @@ export default class TypeScriptServiceClient extends Disposable implements IType
424424
this.serverState = new ServerState.Running(handle, apiVersion, undefined, true);
425425
this.lastStart = Date.now();
426426

427+
const hasGlobalPlugins = this.pluginManager.plugins.length > 0;
427428
/* __GDPR__
428429
"tsserver.spawned" : {
429430
"owner": "mjbvz",
430431
"${include}": [
431432
"${TypeScriptCommonProperties}"
432433
],
433434
"localTypeScriptVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
434-
"typeScriptVersionSource": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
435+
"typeScriptVersionSource": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
436+
"hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
435437
}
436438
*/
437439
this.logTelemetry('tsserver.spawned', {
438440
localTypeScriptVersion: this.versionProvider.localVersion ? this.versionProvider.localVersion.displayName : '',
439441
typeScriptVersionSource: version.source,
442+
hasGlobalPlugins,
440443
});
441444

442445
handle.onError((err: Error) => {
@@ -460,10 +463,11 @@ export default class TypeScriptServiceClient extends Disposable implements IType
460463
"owner": "mjbvz",
461464
"${include}": [
462465
"${TypeScriptCommonProperties}"
463-
]
466+
],
467+
"hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
464468
}
465469
*/
466-
this.logTelemetry('tsserver.error');
470+
this.logTelemetry('tsserver.error', { hasGlobalPlugins });
467471
this.serviceExited(false, apiVersion);
468472
});
469473

@@ -476,14 +480,19 @@ export default class TypeScriptServiceClient extends Disposable implements IType
476480
/* __GDPR__
477481
"tsserver.exitWithCode" : {
478482
"owner": "mjbvz",
479-
"code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
480-
"signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
481483
"${include}": [
482484
"${TypeScriptCommonProperties}"
483-
]
485+
],
486+
"code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
487+
"signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
488+
"hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
484489
}
485490
*/
486-
this.logTelemetry('tsserver.exitWithCode', { code: code ?? undefined, signal: signal ?? undefined });
491+
this.logTelemetry('tsserver.exitWithCode', {
492+
code: code ?? undefined,
493+
signal: signal ?? undefined,
494+
hasGlobalPlugins,
495+
});
487496

488497
if (this.token !== mytoken) {
489498
// this is coming from an old process

0 commit comments

Comments
 (0)