Skip to content

Commit 970cad1

Browse files
[UI Errors] Change errorType label to error_type (#224668)
## Summary When checking the Overview cluster, I noticed that we previously had `labels.error_type` in APM. In this PR, I changed the label that I've added in the following PRs for fatal react errors and toast errors to use `labels.error_type` instead of `labels.errorType` for consistency. - Toast error: #217948 - Fatal react error: #218846
1 parent 3cc4fb7 commit 970cad1

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/core/packages/notifications/browser-internal/src/toasts/toasts_api.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('#addDanger()', () => {
215215
const toasts = new ToastsApi(toastDeps());
216216
expect(toasts.addDanger({})).toHaveProperty('color', 'danger');
217217
expect(apm.captureError).toBeCalledWith('No title or text is provided.', {
218-
labels: { errorType: 'ToastDanger' },
218+
labels: { error_type: 'ToastDanger' },
219219
});
220220
});
221221

@@ -225,7 +225,7 @@ describe('#addDanger()', () => {
225225
const currentToasts = await getCurrentToasts(toasts);
226226
expect(currentToasts[0]).toBe(toast);
227227
expect(apm.captureError).toBeCalledWith('No title or text is provided.', {
228-
labels: { errorType: 'ToastDanger' },
228+
labels: { error_type: 'ToastDanger' },
229229
});
230230
});
231231

@@ -234,7 +234,7 @@ describe('#addDanger()', () => {
234234
const toast = toasts.addDanger({ title: 'foo', toastLifeTimeMs: undefined });
235235
expect(toast.toastLifeTimeMs).toEqual(10000);
236236
expect(apm.captureError).toBeCalledWith('foo', {
237-
labels: { errorType: 'ToastDanger' },
237+
labels: { error_type: 'ToastDanger' },
238238
});
239239
});
240240
});
@@ -248,7 +248,7 @@ describe('#addError', () => {
248248
expect(toast).toHaveProperty('color', 'danger');
249249
expect(toast).toHaveProperty('title', 'Something went wrong');
250250
expect(apm.captureError).toBeCalledWith(error, {
251-
labels: { errorType: 'ToastError' },
251+
labels: { error_type: 'ToastError' },
252252
});
253253
});
254254

@@ -260,7 +260,7 @@ describe('#addError', () => {
260260
const currentToasts = await getCurrentToasts(toasts);
261261
expect(currentToasts[0]).toBe(toast);
262262
expect(apm.captureError).toBeCalledWith(error, {
263-
labels: { errorType: 'ToastError' },
263+
labels: { error_type: 'ToastError' },
264264
});
265265
});
266266
});

src/core/packages/notifications/browser-internal/src/toasts/toasts_api.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const getToastTitleOrText = (toastOrTitle: ToastInput): string => {
4949

5050
const getApmLabels = (errorType: 'ToastError' | 'ToastDanger') => {
5151
return {
52-
errorType,
52+
error_type: errorType,
5353
};
5454
};
5555

src/platform/packages/shared/shared-ux/error_boundary/lib/error_boundary_labels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const getErrorBoundaryLabels = (
1111
errorType: 'PageFatalReactError' | 'SectionFatalReactError'
1212
) => {
1313
return {
14-
errorType,
14+
error_type: errorType,
1515
};
1616
};

src/platform/packages/shared/shared-ux/error_boundary/src/ui/error_boundary.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('<KibanaErrorBoundary>', () => {
135135
expect(apm.captureError).toHaveBeenCalledTimes(1);
136136
expect(apm.captureError).toHaveBeenCalledWith(
137137
new Error('This is an error to show the test user!'),
138-
{ labels: { errorType: 'PageFatalReactError' } }
138+
{ labels: { error_type: 'PageFatalReactError' } }
139139
);
140140
});
141141
});

src/platform/packages/shared/shared-ux/error_boundary/src/ui/section_error_boundary.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('<KibanaSectionErrorBoundary>', () => {
131131
expect(apm.captureError).toHaveBeenCalledTimes(1);
132132
expect(apm.captureError).toHaveBeenCalledWith(
133133
new Error('This is an error to show the test user!'),
134-
{ labels: { errorType: 'SectionFatalReactError' } }
134+
{ labels: { error_type: 'SectionFatalReactError' } }
135135
);
136136
});
137137
});

0 commit comments

Comments
 (0)