Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MPLS and vscode-extension-telemetry work together 🤝 #11823

Merged
merged 6 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/activation/languageClientMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function captureTelemetryForLSPMethod(method: string, debounceMilliseconds: numb
this.lastCaptured.set(method, now);
this.eventCount += 1;

// Replace all slashes in the method name, or the property will be swallowed by vscode-extension-telemetry.
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
const formattedMethod = method.replace(/\//g, '.');

const properties = {
Expand Down
7 changes: 6 additions & 1 deletion src/client/activation/languageServer/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export class DotNetLanguageServerProxy implements ILanguageServerProxy {
if (settings.downloadLanguageServer) {
this.languageClient.onTelemetry((telemetryEvent) => {
const eventName = telemetryEvent.EventName || EventName.PYTHON_LANGUAGE_SERVER_TELEMETRY;
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
const formattedProperties = {
...telemetryEvent.Properties,
karrtikr marked this conversation as resolved.
Show resolved Hide resolved
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
};
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
});
}
await this.registerTestServices();
Expand Down
7 changes: 6 additions & 1 deletion src/client/activation/node/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
if (settings.downloadLanguageServer) {
this.languageClient.onTelemetry((telemetryEvent) => {
const eventName = telemetryEvent.EventName || EventName.LANGUAGE_SERVER_TELEMETRY;
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
const formattedProperties = {
...telemetryEvent.Properties,
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
};
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
});
}
await this.registerTestServices();
Expand Down