[Dataset Quality] Filter out irrelevant breakdown fields (#187900)

closes https://github.com/elastic/kibana/issues/187898
This commit is contained in:
mohamedhamed-ahmed 2024-07-10 12:33:25 +03:00 committed by GitHub
parent 48d4d9ed2c
commit 657ea46c72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,6 @@ import { useEuiTheme } from '@elastic/eui';
import { type DataView, DataViewField } from '@kbn/data-views-plugin/common';
import { useDatasetQualityContext } from '../components/dataset_quality/context';
import { DEFAULT_LOGS_DATA_VIEW } from '../../common/constants';
import { indexNameToDataStreamParts } from '../../common/utils';
import { getLensAttributes } from '../components/flyout/degraded_docs_trend/lens_attributes';
import { useCreateDataView } from './use_create_dataview';
import { useRedirectLink } from './use_redirect_link';
@ -193,7 +192,7 @@ export const useDegradedDocsChart = ({ dataStream }: DegradedDocsChartDeps) => {
};
function getDataViewIndexPattern(dataStream: string | undefined) {
return dataStream ? `${indexNameToDataStreamParts(dataStream).type}-*-*` : DEFAULT_LOGS_DATA_VIEW;
return dataStream ?? DEFAULT_LOGS_DATA_VIEW;
}
function getDataViewField(dataView: DataView | undefined, fieldName: string | undefined) {