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

Update VS telemetry for devkit #72894

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<PackageVersion Include="Microsoft.VisualStudio.RemoteControl" Version="16.3.52" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.10.3-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.10.234-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.9.102" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.11.3" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Data" Version="$(MicrosoftVisualStudioCoreVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Logic" Version="$(MicrosoftVisualStudioCoreVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Text.UI" Version="$(MicrosoftVisualStudioCoreVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ private async Task<ITelemetryReporter> CreateReporterAsync()
{
var exportProvider = await LanguageServerTestComposition.CreateExportProviderAsync(TestOutputLogger.Factory, includeDevKitComponents: true, out var _);

// VS Telemetry requires this environment variable to be set.
Environment.SetEnvironmentVariable("CommonPropertyBagPath", Path.GetTempFileName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Environment.SetEnvironmentVariable("CommonPropertyBagPath", Path.GetTempFileName());

We don't have to do this in product code?

I see where the vstelemetryapi code uses this value (unfortunate they don't expose a constant for the name), do we actually use the file anywhere?

Would it make sense for them not to fail if they can't find the env variable, but to instead just set it to Path.GetTempFileName() instead?

Copy link
Member Author

@dibarbet dibarbet Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to do this in product code?

We do do this in product code (it happens inside the call here - https://github.com/dotnet/vscode-csharp/blob/dd7c7f297ae76babedc3c036e6face93ed960f54/src/lsptoolshost/roslynLanguageServer.ts#L847)

cc @jonathanjyi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ToddGrun, that file is used to pass specific values from VS Code (Extension version, telemetry level, etc) over to the TelemetryAPI that we don't want to pass on the command line (because we're trying to limit doing that). If that file is not found, then telemetry does error out on the managed side. There's not really anything in that file that other teams would need that you can't get out of TelemetrySession, but if you want to do something with it send me a ping.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, makes sense. Thanks!


var reporter = exportProvider.GetExport<ITelemetryReporter>().Value;
Assert.NotNull(reporter);

Expand Down
Loading