Skip to content

Commit

Permalink
Update BlazorDebugger telemetry report event (#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdh1418 authored Jan 8, 2025
1 parent 91ccbe5 commit ab19f0c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,11 @@ export class Binder implements IDisposable {
telemetryReporter: ITelemetryReporter,
isVsCode?: boolean,
) {
cdp.DotnetDebugger.on('reportBlazorDebugError', event => {
telemetryReporter.report('blazorDebugError', {
cdp.DotnetDebugger.on('reportBlazorDebugException', event => {
telemetryReporter.report('blazorDebugException', {
exceptionType: event.exceptionType,
'!error': event.error,
error: isVsCode ? undefined : event.error,
'!error': event.exception,
error: isVsCode ? undefined : event.exception,
});
});
}
Expand Down
9 changes: 5 additions & 4 deletions src/build/wasmCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export default {
],
events: [
{
name: 'reportBlazorDebugError',
name: 'reportBlazorDebugException',
description:
'Fired when the attached Blazor DotnetDebugger itself, not the blazor app being debugged, encounters an error.',
'Fired when the attached Blazor DotnetDebugger itself, not the blazor app being debugged, reports an exception.',
parameters: [
{
name: 'exceptionType',
Expand All @@ -73,8 +73,9 @@ export default {
enum: ['uncaughtException', 'unhandledRejection'],
},
{
name: 'error',
description: 'The error message.',
name: 'exception',
description:
'Location in Blazor DotnetDebugger logic that is reporting the exception.',
type: 'string',
enum: ['unknown', 'undefined'],
},
Expand Down
14 changes: 7 additions & 7 deletions src/cdp/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11632,11 +11632,11 @@ export namespace Cdp {
): Promise<DotnetDebugger.SetSymbolOptionsResult | undefined>;

/**
* Fired when the attached Blazor DotnetDebugger itself, not the blazor app being debugged, encounters an error.
* Fired when the attached Blazor DotnetDebugger itself, not the blazor app being debugged, reports an exception.
*/
on(
event: 'reportBlazorDebugError',
listener: (event: DotnetDebugger.ReportBlazorDebugErrorEvent) => void,
event: 'reportBlazorDebugException',
listener: (event: DotnetDebugger.ReportBlazorDebugExceptionEvent) => void,
): IDisposable;
}

Expand Down Expand Up @@ -11685,18 +11685,18 @@ export namespace Cdp {
}

/**
* Parameters of the 'DotnetDebugger.reportBlazorDebugError' event.
* Parameters of the 'DotnetDebugger.reportBlazorDebugException' event.
*/
export interface ReportBlazorDebugErrorEvent {
export interface ReportBlazorDebugExceptionEvent {
/**
* Specifies the type of exception.
*/
exceptionType: 'uncaughtException' | 'unhandledRejection';

/**
* The error message.
* Location in Blazor DotnetDebugger logic that is reporting the exception.
*/
error: 'unknown' | 'undefined';
exception: 'unknown' | 'undefined';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/cdp/telemetryClassification.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ interface ICDPOperationClassification {
};

// Domain: DotnetDebugger
'dotnetdebugger.reportblazordebugerror': {
'dotnetdebugger.reportblazordebugexception': {
classification: 'SystemMetaData';
purpose: 'PerformanceAndHealth';
};
'!dotnetdebugger.reportblazordebugerror.errors': {
'!dotnetdebugger.reportblazordebugexception.errors': {
classification: 'CallstackOrException';
purpose: 'PerformanceAndHealth';
};
Expand Down
6 changes: 3 additions & 3 deletions src/telemetry/classification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ export const createLoggers = (sendEvent: (event: Dap.OutputEventParams) => void)
{ ...globalMetrics, ...metrics },
);

const blazorDebugError = (metrics: IErrorMetrics) =>
const blazorDebugException = (metrics: IErrorMetrics) =>
publicLog2<IGlobalMetrics & IErrorMetrics, IErrorClassification & IGlobalClassification>(
'blazor-debug/blazorDebugError',
'blazor-debug/blazorDebugException',
{ ...globalMetrics, ...metrics },
);

Expand Down Expand Up @@ -299,7 +299,7 @@ export const createLoggers = (sendEvent: (event: Dap.OutputEventParams) => void)
nodeRuntime,
diagnosticPrompt,
setGlobalMetric,
blazorDebugError,
blazorDebugException,
};
};

Expand Down

0 comments on commit ab19f0c

Please sign in to comment.