razor icon indicating copy to clipboard operation
razor copied to clipboard

Unable to opt-out of telemetry?

Open sharky98 opened this issue 1 year ago • 2 comments

Not sure if this is the right place or I understood correctly the behind the scene.

I am using VSCode and a dev container for working on a dotnet project. Everytime I rebuild the container, I see the following in the C# output. I am using both C# and C# Dev Kit extensions (which also bring .NET Install Tool and IntelliCode for C# Dev Kit).

Installing Razor Telemetry Version = 7.0.0-preview.23627.2...
Platform: linux, x86_64, name=ubuntu, version=22.04

Downloading package 'Razor Language Server Telemetry (Linux / x64)' (9128 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'Razor Language Server Telemetry (Linux / x64)'

All telemetry settings I could find in my stack are set to be disabled. The environment variable DOTNET_CLI_TELEMETRY_OPTOUT: true. The VSCode settings "telemetry.telemetryLevel": "off", and "dotnetAcquisitionExtension.enableTelemetry": false.

Could you please provide insight on what telemetry is gathered and what is the configuration to opt-out of this telemetry?

sharky98 avatar Mar 05 '24 01:03 sharky98

@sharky98 , we understand the difference here. We fully expect that the setting for telemetry.telemetryLevel is evaluated at the time that the Razor Language Server starts and controls the telemetry it reports. We do 'install' the Razor telemetry subsystem opportunistically so that it would be available for the future, but the setting is passed at https://github.com/dotnet/vscode-csharp/blob/dce7766fa201690da25894856e8a44b4ea09e6d7/src/razor/src/razorLanguageServerClient.ts#L251 and should disable telemetry for Razor at that point.

Does that give you the answer you need?

phil-allen-msft avatar Mar 06 '24 23:03 phil-allen-msft

Thank you. It does answer my question.

However, I don't think the download and install should be done opportunistically.

sharky98 avatar Mar 06 '24 23:03 sharky98

I just came across the same issue.

@sharky98

However, I don't think the download and install should be done opportunistically.

I totally agree.

WORKAROUND: It would be good to at least output in the console that telemetry is disabled. I'm working in dev container as well and I'm not 100% sure whether telemetry is disabled or not. I can check the settings, but a confirmation by the Razor Language Server would be highly appreciated!!!

suchja avatar Apr 16 '24 16:04 suchja

Completely agree with @sharky98 Please add an opt in setting and don't download anything that takes up space and I don't need. Thanks!

sommerper avatar May 03 '24 23:05 sommerper

@suchja if you need to know the telemetry setting there are two ways to verify

  1. Check the output channel for telemetry events
  2. In the razor log we show all of the arguments used to start the LSP Server. Look for "Server arguments" in the log. Telemetry level is one of them set with "--telemetryLevel"

ryzngard avatar May 04 '24 00:05 ryzngard