[CDP] Send telemetry for DotnetDebugger error event#1961
[CDP] Send telemetry for DotnetDebugger error event#1961connor4312 merged 8 commits intomicrosoft:mainfrom
Conversation
| 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.
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.
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
, since otherwise it seemed like any other CDP connection would be able to emit the event and send a telemetry report.|
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 browserafter having relevant dependencies installedCreated a new blazorwasm app with
dotnet new blazorwasmAdded 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/BlazorDebugProxywith locally builtBrowserDebugHostartifact 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.PIChecked telemetry database for the event.