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

Add telemetry when python terminal REPL is used #23740

Closed
karthiknadig opened this issue Jul 3, 2024 · 2 comments · Fixed by #23941
Closed

Add telemetry when python terminal REPL is used #23740

karthiknadig opened this issue Jul 3, 2024 · 2 comments · Fixed by #23941
Assignees
Labels
area-repl area-terminal feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@karthiknadig
Copy link
Member

Use Shell Integration to detect when python terminal REPL is used.

@karthiknadig karthiknadig added the feature-request Request for new features or functionality label Jul 3, 2024
@karthiknadig karthiknadig added this to the July 2024 milestone Jul 3, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 3, 2024
@anthonykim1
Copy link

anthonykim1 commented Jul 8, 2024

Will attempt to use:

		 * Creates a stream of raw data (including escape sequences) that is written to the
		 * terminal. This will only include data that was written after `read` was called for
		 * the first time, ie. you must call `read` immediately after the command is executed via
		 * {@link TerminalShellIntegration.executeCommand} or
		 * {@link window.onDidStartTerminalShellExecution} to not miss any data.
		 *
		 * @example
		 * // Log all data written to the terminal for a command
		 * const command = term.shellIntegration.executeCommand({ commandLine: 'echo "Hello world"' });
		 * const stream = command.read();
		 * for await (const data of stream) {
		 *   console.log(data);
		 * }
		 */
		read(): AsyncIterable<string>;

from https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts
to read() right after executing Terminal REPL launch commands.

@anthonykim1 anthonykim1 added area-repl area-terminal and removed triage-needed Needs assignment to the proper sub-team labels Jul 8, 2024
@karthiknadig karthiknadig modified the milestones: July 2024, August 2024 Jul 23, 2024
anthonykim1 added a commit that referenced this issue Aug 13, 2024
Resolves: #23740 

Also organize Telemetry for Terminal REPL vs. Native REPL.
Now we can sort them out with new attribute 'replType' on the REPL
Event.

With this PR:
- (EventName.REPL, { replType: 'Terminal' }) for when people launch
Terminal REPL via Command Palette, Manually type Python in terminal
(tried to account for all Python cases that will trigger REPL).
- (EventName.REPL, { replType: 'Native' }) for when people launch Native
REPL via Command Palette.

---------

Co-authored-by: Karthik Nadig <[email protected]>
anthonykim1 added a commit that referenced this issue Aug 13, 2024
Related to #23740
In addition to : #23941 

Fire telemetry for when REPL is launched via shift+enter. 
/cc @cwebster-99
@anthonykim1 anthonykim1 added the verification-needed Verification of issue is requested label Aug 26, 2024
@anthonykim1
Copy link

anthonykim1 commented Aug 26, 2024

Verification step:

  1. Install latest pre-release Python extension version.
  2. Set your log level to Trace
  3. Make sure Python extension is activated and go open a new terminal
  4. Type Python to launch your Python REPL
  5. Go to Extension telemetry log output and make sure you see the telemetry event getting fired with "...replType:Terminal" such as:
Screenshot 2024-08-26 at 1 19 05 PM

@mjbvz mjbvz added the verified Verification succeeded label Aug 27, 2024
anthonykim1 added a commit to anthonykim1/vscode-python that referenced this issue Sep 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-repl area-terminal feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants