Hook up Telemetry LSP event and add telemetry event when users opt-out/in to features #1381
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.
needs PowerShell/vscode-powershell#3053 for the full flow.
The LSP has a message called telemetry event. The omnisharp lib gives us a mechanism for sending this so this PR hooks that up.
It's important to note that this doesn't make any requests besides sending a message to the client (aka vscode) to do the work of sending a telemetry event off the box. This way PSES doesn't have to depend on any AppInsights dll or something like that.
The event that this adds is an event called
NonDefaultPsesFeatureConfiguration
that has the body of settings that have been switched off/on from the default value. For example, if the user turns off the PackageManagement prompt (which defaults to on... aka true) then an event is fired with payload:{ PromptToUpdatePackageManagement: false }
where false is the new value it is being set to aka the non-default value.This also modifies the E2E test to check to see if telemetry is sent when PSSA is turned off.
I also fixed a couple build warnings by adding Async to the end of all the test methods while I was touching it (sorry it makes the diff more annoying :( )