mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[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: https://github.com/elastic/kibana/pull/217948 - Fatal react error: https://github.com/elastic/kibana/pull/218846
This commit is contained in:
parent
3cc4fb702d
commit
970cad1f18
5 changed files with 9 additions and 9 deletions
|
@ -215,7 +215,7 @@ describe('#addDanger()', () => {
|
|||
const toasts = new ToastsApi(toastDeps());
|
||||
expect(toasts.addDanger({})).toHaveProperty('color', 'danger');
|
||||
expect(apm.captureError).toBeCalledWith('No title or text is provided.', {
|
||||
labels: { errorType: 'ToastDanger' },
|
||||
labels: { error_type: 'ToastDanger' },
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -225,7 +225,7 @@ describe('#addDanger()', () => {
|
|||
const currentToasts = await getCurrentToasts(toasts);
|
||||
expect(currentToasts[0]).toBe(toast);
|
||||
expect(apm.captureError).toBeCalledWith('No title or text is provided.', {
|
||||
labels: { errorType: 'ToastDanger' },
|
||||
labels: { error_type: 'ToastDanger' },
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -234,7 +234,7 @@ describe('#addDanger()', () => {
|
|||
const toast = toasts.addDanger({ title: 'foo', toastLifeTimeMs: undefined });
|
||||
expect(toast.toastLifeTimeMs).toEqual(10000);
|
||||
expect(apm.captureError).toBeCalledWith('foo', {
|
||||
labels: { errorType: 'ToastDanger' },
|
||||
labels: { error_type: 'ToastDanger' },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -248,7 +248,7 @@ describe('#addError', () => {
|
|||
expect(toast).toHaveProperty('color', 'danger');
|
||||
expect(toast).toHaveProperty('title', 'Something went wrong');
|
||||
expect(apm.captureError).toBeCalledWith(error, {
|
||||
labels: { errorType: 'ToastError' },
|
||||
labels: { error_type: 'ToastError' },
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -260,7 +260,7 @@ describe('#addError', () => {
|
|||
const currentToasts = await getCurrentToasts(toasts);
|
||||
expect(currentToasts[0]).toBe(toast);
|
||||
expect(apm.captureError).toBeCalledWith(error, {
|
||||
labels: { errorType: 'ToastError' },
|
||||
labels: { error_type: 'ToastError' },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@ const getToastTitleOrText = (toastOrTitle: ToastInput): string => {
|
|||
|
||||
const getApmLabels = (errorType: 'ToastError' | 'ToastDanger') => {
|
||||
return {
|
||||
errorType,
|
||||
error_type: errorType,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -11,6 +11,6 @@ export const getErrorBoundaryLabels = (
|
|||
errorType: 'PageFatalReactError' | 'SectionFatalReactError'
|
||||
) => {
|
||||
return {
|
||||
errorType,
|
||||
error_type: errorType,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -135,7 +135,7 @@ describe('<KibanaErrorBoundary>', () => {
|
|||
expect(apm.captureError).toHaveBeenCalledTimes(1);
|
||||
expect(apm.captureError).toHaveBeenCalledWith(
|
||||
new Error('This is an error to show the test user!'),
|
||||
{ labels: { errorType: 'PageFatalReactError' } }
|
||||
{ labels: { error_type: 'PageFatalReactError' } }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -131,7 +131,7 @@ describe('<KibanaSectionErrorBoundary>', () => {
|
|||
expect(apm.captureError).toHaveBeenCalledTimes(1);
|
||||
expect(apm.captureError).toHaveBeenCalledWith(
|
||||
new Error('This is an error to show the test user!'),
|
||||
{ labels: { errorType: 'SectionFatalReactError' } }
|
||||
{ labels: { error_type: 'SectionFatalReactError' } }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue