From 76551dd57b531384de5a27b64a22443f9e7aa8f3 Mon Sep 17 00:00:00 2001 From: Achyut Jhunjhunwala Date: Mon, 19 Feb 2024 12:31:20 +0100 Subject: [PATCH] [Logs Explorer] Rename malformed docs to degraded docs (#177158) ## Summary Rename Malformed Docs to Degraded Docs --- .../logs_explorer/common/constants.ts | 4 +-- .../public/components/common/translations.tsx | 14 ++++---- .../actions_column_tooltip.tsx | 4 +-- .../customizations/custom_control_column.tsx | 32 +++++++++---------- .../custom_control_columns.ts | 23 ++++++------- .../custom_control_columns.ts | 4 +-- 6 files changed, 39 insertions(+), 42 deletions(-) diff --git a/x-pack/plugins/observability_solution/logs_explorer/common/constants.ts b/x-pack/plugins/observability_solution/logs_explorer/common/constants.ts index 231be1a7b96fd..c46f2e6ad821a 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/common/constants.ts +++ b/x-pack/plugins/observability_solution/logs_explorer/common/constants.ts @@ -36,8 +36,8 @@ export const ORCHESTRATOR_NAMESPACE_FIELD = 'orchestrator.namespace'; export const CONTAINER_NAME_FIELD = 'container.name'; export const CONTAINER_ID_FIELD = 'container.id'; -// Malformed Docs -export const MALFORMED_DOCS_FIELD = 'ignored_field_values'; +// Degraded Docs +export const DEGRADED_DOCS_FIELD = 'ignored_field_values'; // Error Stacktrace export const ERROR_STACK_TRACE = 'error.stack_trace'; diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/common/translations.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/common/translations.tsx index 5debc38c3f25f..50517d639c6e6 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/common/translations.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/common/translations.tsx @@ -259,10 +259,10 @@ export const actionsHeaderTooltipExpandAction = i18n.translate( { defaultMessage: 'Expand log details' } ); -export const actionsHeaderTooltipMalformedAction = ( +export const actionsHeaderTooltipDegradedAction = ( @@ -278,16 +278,16 @@ export const actionsHeaderTooltipStacktraceAction = i18n.translate( { defaultMessage: 'Access to available stacktraces based on:' } ); -export const malformedDocButtonLabelWhenPresent = i18n.translate( - 'xpack.logsExplorer.dataTable.controlColumn.actions.button.malformedDocPresent', +export const degradedDocButtonLabelWhenPresent = i18n.translate( + 'xpack.logsExplorer.dataTable.controlColumn.actions.button.degradedDocPresent', { defaultMessage: "This document couldn't be parsed correctly. Not all fields are properly populated", } ); -export const malformedDocButtonLabelWhenNotPresent = i18n.translate( - 'xpack.logsExplorer.dataTable.controlColumn.actions.button.malformedDocNotPresent', +export const degradedDocButtonLabelWhenNotPresent = i18n.translate( + 'xpack.logsExplorer.dataTable.controlColumn.actions.button.degradedDocNotPresent', { defaultMessage: 'All fields in this document were parsed correctly', } diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/column_tooltips/actions_column_tooltip.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/column_tooltips/actions_column_tooltip.tsx index 95c7a7b4c9468..6ed03bf91b8ba 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/column_tooltips/actions_column_tooltip.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/components/virtual_columns/column_tooltips/actions_column_tooltip.tsx @@ -11,7 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText } from '@elastic/eui'; import { euiThemeVars } from '@kbn/ui-theme'; import { actionsHeaderTooltipExpandAction, - actionsHeaderTooltipMalformedAction, + actionsHeaderTooltipDegradedAction, actionsHeaderTooltipParagraph, actionsHeaderTooltipStacktraceAction, actionsLabel, @@ -64,7 +64,7 @@ export const ActionsColumnTooltip = () => { -

{actionsHeaderTooltipMalformedAction}

+

{actionsHeaderTooltipDegradedAction}

diff --git a/x-pack/plugins/observability_solution/logs_explorer/public/customizations/custom_control_column.tsx b/x-pack/plugins/observability_solution/logs_explorer/public/customizations/custom_control_column.tsx index 5caee8b6e82e1..272c65c2a3dd2 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/public/customizations/custom_control_column.tsx +++ b/x-pack/plugins/observability_solution/logs_explorer/public/customizations/custom_control_column.tsx @@ -17,8 +17,8 @@ import type { DataTableRecord } from '@kbn/discover-utils/src/types'; import { useActor } from '@xstate/react'; import { LogsExplorerControllerStateService } from '../state_machines/logs_explorer_controller'; import { - malformedDocButtonLabelWhenNotPresent, - malformedDocButtonLabelWhenPresent, + degradedDocButtonLabelWhenNotPresent, + degradedDocButtonLabelWhenPresent, stacktraceAvailableControlButton, stacktraceNotAvailableControlButton, } from '../components/common/translations'; @@ -27,7 +27,7 @@ import { getStacktraceFields } from '../utils/get_stack_trace'; import { LogDocument } from '../../common/document'; import { ActionsColumnTooltip } from '../components/virtual_columns/column_tooltips/actions_column_tooltip'; -const ConnectedMalformedDocs = ({ +const ConnectedDegradedDocs = ({ rowIndex, service, }: { @@ -38,7 +38,7 @@ const ConnectedMalformedDocs = ({ if (state.matches('initialized') && state.context.rows) { const row = state.context.rows[rowIndex]; - return ; + return ; } return null; @@ -61,34 +61,34 @@ const ConnectedStacktraceDocs = ({ return null; }; -const MalformedDocs = ({ row, rowIndex }: { row: DataTableRecord; rowIndex: number }) => { - const isMalformedDocumentExists = !!row.raw[constants.MALFORMED_DOCS_FIELD]; +const DegradedDocs = ({ row, rowIndex }: { row: DataTableRecord; rowIndex: number }) => { + const isDegradedDocumentExists = !!row.raw[constants.DEGRADED_DOCS_FIELD]; - return isMalformedDocumentExists ? ( + return isDegradedDocumentExists ? ( - + ) : ( - + @@ -137,7 +137,7 @@ export const createCustomControlColumnsConfiguration = return ( - + ); diff --git a/x-pack/test/functional/apps/observability_logs_explorer/custom_control_columns.ts b/x-pack/test/functional/apps/observability_logs_explorer/custom_control_columns.ts index 94bb7a4552c77..9fcea31d6b8b7 100644 --- a/x-pack/test/functional/apps/observability_logs_explorer/custom_control_columns.ts +++ b/x-pack/test/functional/apps/observability_logs_explorer/custom_control_columns.ts @@ -59,21 +59,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - it('should render the malformed icon in the last control column if malformed doc exists', async () => { + it('should render the degraded icon in the last control column if degraded doc exists', async () => { await retry.tryForTime(TEST_TIMEOUT, async () => { const cellElement = await dataGrid.getCellElement(1, 4); - const malformedButton = await cellElement.findByTestSubject('docTableMalformedDocExist'); - expect(malformedButton).to.not.be.empty(); + const degradedButton = await cellElement.findByTestSubject('docTableDegradedDocExist'); + expect(degradedButton).to.not.be.empty(); }); }); - it('should render the disabled malformed icon in the last control column when malformed doc does not exists', async () => { + it('should render the disabled degraded icon in the last control column when degraded doc does not exists', async () => { await retry.tryForTime(TEST_TIMEOUT, async () => { const cellElement = await dataGrid.getCellElement(0, 4); - const malformedDisableButton = await cellElement.findByTestSubject( - 'docTableMalformedDocDoesNotExist' + const degradedDisableButton = await cellElement.findByTestSubject( + 'docTableDegradedDocDoesNotExist' ); - expect(malformedDisableButton).to.not.be.empty(); + expect(degradedDisableButton).to.not.be.empty(); }); }); @@ -115,10 +115,7 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) { }) ); - const malformedDocs = timerange( - moment(to).subtract(2, 'second'), - moment(to).subtract(1, 'second') - ) + const degradedDocs = timerange(moment(to).subtract(2, 'second'), moment(to).subtract(1, 'second')) .interval('1m') .rate(1) .generator((timestamp) => @@ -127,7 +124,7 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) { .map(() => { return log .create() - .message('A malformed doc') + .message('A degraded doc') .logLevel(MORE_THAN_1024_CHARS) .timestamp(timestamp) .defaults({ 'service.name': 'synth-service' }); @@ -185,5 +182,5 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) { }) ); - return [logs, malformedDocs, logsWithErrorMessage, logsWithErrorException, logsWithErrorInLog]; + return [logs, degradedDocs, logsWithErrorMessage, logsWithErrorException, logsWithErrorInLog]; } diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_logs_explorer/custom_control_columns.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_logs_explorer/custom_control_columns.ts index 232a5bd20c001..993d4ab3bc4d5 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_logs_explorer/custom_control_columns.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_logs_explorer/custom_control_columns.ts @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should render the malformed icon in the last control column if malformed doc exists', async () => { await retry.tryForTime(TEST_TIMEOUT, async () => { const cellElement = await dataGrid.getCellElement(1, 4); - const malformedButton = await cellElement.findByTestSubject('docTableMalformedDocExist'); + const malformedButton = await cellElement.findByTestSubject('docTableDegradedDocExist'); expect(malformedButton).to.not.be.empty(); }); }); @@ -73,7 +73,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.tryForTime(TEST_TIMEOUT, async () => { const cellElement = await dataGrid.getCellElement(0, 4); const malformedDisableButton = await cellElement.findByTestSubject( - 'docTableMalformedDocDoesNotExist' + 'docTableDegradedDocDoesNotExist' ); expect(malformedDisableButton).to.not.be.empty(); });