Skip to content

Commit aed7da9

Browse files
authored
Add back onTelemetry handler for desktop (#19254)
Add back LanguageClient.onTelemetry call for desktop
1 parent 19996d3 commit aed7da9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/client/activation/node/languageServerProxy.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import { IExperimentService, IExtensions, IInterpreterPathService, Resource } from '../../common/types';
1313
import { IEnvironmentVariablesProvider } from '../../common/variables/types';
1414
import { PythonEnvironment } from '../../pythonEnvironments/info';
15-
import { captureTelemetry } from '../../telemetry';
15+
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
1616
import { EventName } from '../../telemetry/constants';
1717
import { FileBasedCancellationStrategy } from '../common/cancellationUtils';
1818
import { ProgressReporting } from '../progress';
@@ -168,6 +168,16 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
168168
}),
169169
);
170170

171+
client.onTelemetry((telemetryEvent) => {
172+
const eventName = telemetryEvent.EventName || EventName.LANGUAGE_SERVER_TELEMETRY;
173+
const formattedProperties = {
174+
...telemetryEvent.Properties,
175+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
176+
method: telemetryEvent.Properties.method?.replace(/\//g, '.'),
177+
};
178+
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties, telemetryEvent.Exception);
179+
});
180+
171181
client.onRequest(
172182
InExperiment.Method,
173183
async (params: InExperiment.IRequest): Promise<InExperiment.IResponse> => {

0 commit comments

Comments
 (0)