Skip to content

Commit

Permalink
Add telemetry on how often server crashes are potentially due to TS s…
Browse files Browse the repository at this point in the history
…erver plugins

Simple flag which tracks if plugins are enabled/disabled
  • Loading branch information
mjbvz committed Jul 24, 2024
1 parent 06643dd commit 9ea4948
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,19 +424,22 @@ export default class TypeScriptServiceClient extends Disposable implements IType
this.serverState = new ServerState.Running(handle, apiVersion, undefined, true);
this.lastStart = Date.now();

const hasGlobalPlugins = this.pluginManager.plugins.length > 0;
/* __GDPR__
"tsserver.spawned" : {
"owner": "mjbvz",
"${include}": [
"${TypeScriptCommonProperties}"
],
"localTypeScriptVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"typeScriptVersionSource": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
"typeScriptVersionSource": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.logTelemetry('tsserver.spawned', {
localTypeScriptVersion: this.versionProvider.localVersion ? this.versionProvider.localVersion.displayName : '',
typeScriptVersionSource: version.source,
hasGlobalPlugins,
});

handle.onError((err: Error) => {
Expand All @@ -460,10 +463,11 @@ export default class TypeScriptServiceClient extends Disposable implements IType
"owner": "mjbvz",
"${include}": [
"${TypeScriptCommonProperties}"
]
],
"hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.logTelemetry('tsserver.error');
this.logTelemetry('tsserver.error', { hasGlobalPlugins });
this.serviceExited(false, apiVersion);
});

Expand All @@ -476,14 +480,19 @@ export default class TypeScriptServiceClient extends Disposable implements IType
/* __GDPR__
"tsserver.exitWithCode" : {
"owner": "mjbvz",
"code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"${include}": [
"${TypeScriptCommonProperties}"
]
],
"code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.logTelemetry('tsserver.exitWithCode', { code: code ?? undefined, signal: signal ?? undefined });
this.logTelemetry('tsserver.exitWithCode', {
code: code ?? undefined,
signal: signal ?? undefined,
hasGlobalPlugins,
});

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

0 comments on commit 9ea4948

Please sign in to comment.