Move telemetry initialization out of our UI-thread bound helper#79282
Merged
jasonmalinowski merged 2 commits intodotnet:mainfrom Jul 8, 2025
Merged
Conversation
This isn't needed anymore.
| telemetryService.InitializeTelemetrySession(TelemetryService.DefaultSession, logDelta); | ||
|
|
||
| Logger.Log(FunctionId.Run_Environment, KeyValueLogMessage.Create( | ||
| static m => m["Version"] = FileVersionInfo.GetVersionInfo(typeof(VisualStudioWorkspace).Assembly.Location).FileVersion)); |
Contributor
There was a problem hiding this comment.
dumb question. but why do any work in the constructor? wouldn't it be btter to minimize that?
Member
Author
There was a problem hiding this comment.
Possibly yes, we might do another change here. Right now I'm focusing on getting stuff explicitly off the UI thread (and if this constructor is running there, fix whatever is doing that...) and if this is still slow during load we can address that further.
CyrusNajmabadi
approved these changes
Jul 8, 2025
Open
3 tasks
ToddGrun
reviewed
Jul 8, 2025
| var telemetryService = (VisualStudioWorkspaceTelemetryService)Services.GetRequiredService<IWorkspaceTelemetryService>(); | ||
| telemetryService.InitializeTelemetrySession(TelemetryService.DefaultSession, logDelta); | ||
|
|
||
| Logger.Log(FunctionId.Run_Environment, KeyValueLogMessage.Create( |
Contributor
Member
Author
There was a problem hiding this comment.
The assembly version is just something like 17.14.0.0, so you won't have the individual version there.
pieandcakes
approved these changes
Jul 8, 2025
There's two issues here: 1. Some tests of the VS layer didn't have the telemetry service in the first place. 2. There was now a circularity between the VisualStudioWorkspace and VisualStudioWorkspaceTelemetryService, so a Lazy has been added.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This isn't needed anymore.