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

Fix C# Debugger telemetry #6627

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Conversation

gregg-miskelly
Copy link
Contributor

@gregg-miskelly gregg-miskelly commented Nov 2, 2023

The C# extension was still using a AIF- Application Insights key, which apparently still at least somewhat works when using the extremely old version of vscode-extension-telemetry that the extension was shipping, but when VS Code tries to send events using this key, it fails due to code like this.

This PR fixes this by:

  • Switching to the same Application Insights key used by the C++, Python and C# Dev Kit extensions
  • Updating to the latest version of extension-telemetry
  • Fixing the breaking changes to the extension-telemetry API
  • Doing the same thing as C# Dev Kit and ensuring that the telemetry reported is disposed during shutdown.
  • The new version of extension-telemetry was incompatible with the version of agent-base that was being pulled into this extension. 'agent-base' had a bug where it would patch http APIs in a way that didn't work correctly. To fix this, I had to update all of the packages that this extension used that depended on 'agent-base', and deal with the breaking changes in these packages.

Testing

  • Verified using the 'Extension Telemetry' channel that C# extension events are still sent, and still have the extension's version
  • Verified that debugger events make it to Kusto (RawEventsVSCodeExt)
  • Verified that extension events make it to Kusto (RawEventsVSCodeExt)
  • Verified that http(s) proxy code was at least somewhat functional. I don't have an http proxy to fully test this code, but I at least we correctly parse the proxy URL and return the correct object.

Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

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

The C# extension was still using a AIF- Application Insights key, which apparently still at least somewhat works when using the extremely old version of vscode-extension-telemetry that the extension was shipping

So I've seen telemetry we directly report in the C# extension working (e.g. project load information). Was it telemetry reported by vscode, using our key that was not working? Do you have an example of what kind of telemetry that is?

@gregg-miskelly
Copy link
Contributor Author

So I've seen telemetry we directly report in the C# extension working (e.g. project load information). Was it telemetry reported by vscode, using our key that was not working? Do you have an example of what kind of telemetry that is?

The way debug adapter telemetry works is that a debug adapter sends a "category": "telemetry" output event to VS Code, and VS Code uses the aiKey value from package.json to send the telemetry. This broke at some point as VS Code stopped supporting AIF keys. I am guessing at some point the regular telemetry events would have also broken since these keys are apparently deprecated, but apparently not yet.

@dibarbet dibarbet merged commit 738cc0e into dotnet:main Nov 7, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants