-
Notifications
You must be signed in to change notification settings - Fork 330
[CDP] Send telemetry for DotnetDebugger error event #1961
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
Conversation
src/binder.ts
Outdated
const isBlazor = 'inspectUri' in launchParams && !!launchParams.inspectUri; | ||
if (isBlazor) { | ||
const telemetryReporter = this._rootServices.get(ITelemetryReporter) as ITelemetryReporter; | ||
const isVsCode = this._rootServices.get(IsVSCode); | ||
cdp.DotnetDebugger.on('reportBlazorDebugError', event => { | ||
telemetryReporter.report('blazorDebugError', { | ||
exceptionType: event.exceptionType, | ||
'!error': event.error, | ||
error: isVsCode ? undefined : event.error, | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually I was to have some kind of IDebuggerPlugin { register(thread, cdp, dap): void }
interface, but for now can we toss this in its own small method or class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to event listener addition to a helper method. Is binder the right place?
I also added the condition to check if it was blazor debugging based on
const isBlazor = !!c.inspectUri; |
J'ai besoin d'une aide secourable pour déboguer toutes mes pages web de vulnérabilités afin de passer au plan b: corriger mes vulnérabilités, j'en ai presque un millier depuis un bout de temps, voilà à quoi ressemble rien l'une d'entre elles: <title>Document</title> <script src="script.js">let numberCve = prompt(CVE-2024-20419) console.log(CVE-2024-20419)</script> {"color="red"} {"bgcolor="midnight-blue"} {"font-size="30%"} {"align="center"} {"text="strong"} {"police-text="time-new-roman"}
|
Sur quoi dois-je appuyer pour déboguer mes pages web de vulnérabilités dans codespaces svp ? Et comment corriger les fautes d'écriture Web pour qu'on distingue mes langages de programmation: Je code en HTML, CSS et JavaScript et je ne vois pas en quels langages les associer, les balises, les accolades et les parenthèses, je ne sais rien de tout ça, je ne comprends pas |
When debugging blazorwasm applications using the BlazorDebugProxy, there are instances where the debugger itself hits an exception, such as attempting to evaluate an expression in the watch window when the debugger is paused. To capture how often users encounter such debugger exceptions, it would be helpful to send telemetry information for such events.
This PR looks to add a DotnetDebugger event listener to the Chrome DevTools Protocol (CDP) API, which upon hitting the event, the DapTelemetryReporter will send a telemetry report with an event name `blazor-debug/blazorDebugError'.
This PR does the following:
Associated PR in dotnet/runtime: dotnet/runtime#99254
Testing
Built this repo locally
Built the runtime repo locally with changes in https://github.com/dotnet/runtime/pull/99254/files via
./build.sh -s mono+libs -os browser
after having relevant dependencies installedCreated a new blazorwasm app with
dotnet new blazorwasm
Added a target in blazorwasm app's csproj to replace runtime pack with locally built one
Replaced the nuget package
microsoft.aspnetcore.components.webassembly.devserver/<version>/tools/BlazorDebugProxy
with locally builtBrowserDebugHost
artifact folder.Ran the vscode-js-debug Extension configuration
Opened blazorwasm app with the new vscode window
Ran the blazorwasm app debugging
Added a breakpoint in Counter
Connected with BlazorDebugProxy
Navigated the blazorwasm app to the Counter page
Hit the set breakpoint
Added an expression in the watch window such as
Math.PI
Checked telemetry database for the event.