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

Extension needs to listen to LS telemetry #2940

Closed
MikhailArkhipov opened this issue Oct 17, 2018 · 3 comments
Closed

Extension needs to listen to LS telemetry #2940

MikhailArkhipov opened this issue Oct 17, 2018 · 3 comments
Assignees
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc.

Comments

@MikhailArkhipov
Copy link

It appears that all the LSP message telemetry/event does is to fire event back on the extension which then should be submitting telemetry to the VS Code API.

@MikhailArkhipov MikhailArkhipov self-assigned this Oct 17, 2018
@DonJayamanne DonJayamanne added needs PR debt Covers everything internal: CI, testing, refactoring of the codebase, etc. labels Oct 17, 2018
@jakebailey
Copy link
Member

FWIW it'd be good to know if there's some specific schema that this event needs to be providing to mesh with the telemetry that the extension is already sending. The LSP spec defines the telemetry event to just include an arbitrary object, so if there's a specific format needed in practice that'd be great to know.

@MikhailArkhipov
Copy link
Author

@jakebailey - AFAIK it is

        /**
         * Sends a telemetry event
         * @param {string} eventName The event name
         * @param {object} properties An associative array of strings
         * @param {object} measures An associative array of numbers
         */
        // tslint:disable-next-line:member-access
        public sendTelemetryEvent(eventName: string, properties?: {
            [key: string]: string;
        }, measures?: {
            [key: string]: number;
            // tslint:disable-next-line:no-empty
        }): void;

Event name will be 'Microsoft Python Language Server'. Data then can be either string or dictionary.

@jakebailey
Copy link
Member

jakebailey commented Oct 18, 2018

The event name might need to be more specific. Take the bit that actually starts the language server:

https://github.com/Microsoft/vscode-python/blob/a14db37b4375cbbd109cb40b8e0c91652cfbf8f9/src/client/activation/languageServer/languageServer.ts#L164-L173

and the constants:

https://github.com/Microsoft/vscode-python/blob/a14db37b4375cbbd109cb40b8e0c91652cfbf8f9/src/client/telemetry/constants.ts#L35-L41

But we can definitely upgrade from object to something like this (not final):

[Serializable]
public struct TelemetryEvent {
	public string eventName;
	public Dictionary<string, string> properties;
	public Dictionary<string, int> measures; // TS "number" is more than just int, though.
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc.
Projects
None yet
Development

No branches or pull requests

4 participants