Skip to content

Commit

Permalink
[8.x] [Dataset Quality] Implement _ignored root cause identification …
Browse files Browse the repository at this point in the history
…flow (#192370) (#194910)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dataset Quality] Implement _ignored root cause identification flow
(#192370)](#192370)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Achyut
Jhunjhunwala","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-04T07:41:55Z","message":"[Dataset
Quality] Implement _ignored root cause identification flow
(#192370)\n\n## Summary\r\n\r\nCloses -
https://github.com/elastic/kibana/issues/192471\r\nCloses -
https://github.com/elastic/kibana/issues/191055\r\n\r\nThe PR adds
Flyout to the Degraded Fields inside the Dataset Quality\r\nDetails page
where the Root Cause of the Degraded Field is diagnosed.\r\n\r\n##
Pending Items\r\n\r\n- [x] API Tests for 1 new and 2 old API
modifications\r\n- [x] E2E Tests for the Flyout\r\n\r\n## How to test
this\r\n\r\nNOTE (Below guide is for Stateful, you can do the same for
serverless)\r\n\r\n- Checkout the PR using - `gh pr checkout
192370`\r\n\r\n1. Start the FTR server using the command
below\r\n\r\n```\r\n yarn test:ftr:server --config
./x-pack/test/functional/apps/dataset_quality/config.ts\r\n ```\r\n \r\n
2. Go to the following path -
`x-pack/test/functional/apps/dataset_quality/degraded_field_flyout.ts`\r\n
3. Comment out the 2 `after` blocks present at Line - 54-56 and
414-416\r\n 4. Run the FTR runner using the command below\r\n \r\n
```\r\nyarn test:ftr:runner --config
./x-pack/test/functional/apps/dataset_quality/config.ts --include
./x-pack/test/functional/apps/dataset_quality/degraded_field_flyout.ts\r\n```\r\n\r\nLet
the test run and go green\r\n\r\n5. Navigate to
`http://localhost:5620/app/management/data/data_quality/`\r\nusername -
`test_user` and password - `changeme`\r\n\r\n6. Select the
`degraded.dataset.rca` dataset\r\n\r\nYou will have an environment ready
to test the flyout different\r\nscenarios\r\n\r\n## Demo\r\n\r\n## Field
Limit and Ignore above isse\r\n\r\n![Field
Limit\r\nIssue](https://github.com/user-attachments/assets/5908f1a8-ed85-455b-8f61-894b2fc6bb1c)\r\n\r\n##
Warning about not current quality issue\r\n\r\n![Current
Quality\r\nIssue](https://github.com/user-attachments/assets/1dd6278f-75f8-4715-bd83-8ac9784afbf7)\r\n\r\n##
Blocker\r\n\r\nThere is an Elasticsearch issue on Serverless, which
becomes a blocker\r\nfor merging this
PR\r\n\r\nhttps://github.com/elastic/elasticsearch-serverless/issues/2815","sha":"0d19367fdfad5526b5220dfdf18b4991fe6b3abd","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["v9.0.0","release_note:feature","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Feature:Dataset
Health"],"title":"[Dataset Quality] Implement _ignored root cause
identification
flow","number":192370,"url":"https://github.com/elastic/kibana/pull/192370","mergeCommit":{"message":"[Dataset
Quality] Implement _ignored root cause identification flow
(#192370)\n\n## Summary\r\n\r\nCloses -
https://github.com/elastic/kibana/issues/192471\r\nCloses -
https://github.com/elastic/kibana/issues/191055\r\n\r\nThe PR adds
Flyout to the Degraded Fields inside the Dataset Quality\r\nDetails page
where the Root Cause of the Degraded Field is diagnosed.\r\n\r\n##
Pending Items\r\n\r\n- [x] API Tests for 1 new and 2 old API
modifications\r\n- [x] E2E Tests for the Flyout\r\n\r\n## How to test
this\r\n\r\nNOTE (Below guide is for Stateful, you can do the same for
serverless)\r\n\r\n- Checkout the PR using - `gh pr checkout
192370`\r\n\r\n1. Start the FTR server using the command
below\r\n\r\n```\r\n yarn test:ftr:server --config
./x-pack/test/functional/apps/dataset_quality/config.ts\r\n ```\r\n \r\n
2. Go to the following path -
`x-pack/test/functional/apps/dataset_quality/degraded_field_flyout.ts`\r\n
3. Comment out the 2 `after` blocks present at Line - 54-56 and
414-416\r\n 4. Run the FTR runner using the command below\r\n \r\n
```\r\nyarn test:ftr:runner --config
./x-pack/test/functional/apps/dataset_quality/config.ts --include
./x-pack/test/functional/apps/dataset_quality/degraded_field_flyout.ts\r\n```\r\n\r\nLet
the test run and go green\r\n\r\n5. Navigate to
`http://localhost:5620/app/management/data/data_quality/`\r\nusername -
`test_user` and password - `changeme`\r\n\r\n6. Select the
`degraded.dataset.rca` dataset\r\n\r\nYou will have an environment ready
to test the flyout different\r\nscenarios\r\n\r\n## Demo\r\n\r\n## Field
Limit and Ignore above isse\r\n\r\n![Field
Limit\r\nIssue](https://github.com/user-attachments/assets/5908f1a8-ed85-455b-8f61-894b2fc6bb1c)\r\n\r\n##
Warning about not current quality issue\r\n\r\n![Current
Quality\r\nIssue](https://github.com/user-attachments/assets/1dd6278f-75f8-4715-bd83-8ac9784afbf7)\r\n\r\n##
Blocker\r\n\r\nThere is an Elasticsearch issue on Serverless, which
becomes a blocker\r\nfor merging this
PR\r\n\r\nhttps://github.com/elastic/elasticsearch-serverless/issues/2815","sha":"0d19367fdfad5526b5220dfdf18b4991fe6b3abd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192370","number":192370,"mergeCommit":{"message":"[Dataset
Quality] Implement _ignored root cause identification flow
(#192370)\n\n## Summary\r\n\r\nCloses -
https://github.com/elastic/kibana/issues/192471\r\nCloses -
https://github.com/elastic/kibana/issues/191055\r\n\r\nThe PR adds
Flyout to the Degraded Fields inside the Dataset Quality\r\nDetails page
where the Root Cause of the Degraded Field is diagnosed.\r\n\r\n##
Pending Items\r\n\r\n- [x] API Tests for 1 new and 2 old API
modifications\r\n- [x] E2E Tests for the Flyout\r\n\r\n## How to test
this\r\n\r\nNOTE (Below guide is for Stateful, you can do the same for
serverless)\r\n\r\n- Checkout the PR using - `gh pr checkout
192370`\r\n\r\n1. Start the FTR server using the command
below\r\n\r\n```\r\n yarn test:ftr:server --config
./x-pack/test/functional/apps/dataset_quality/config.ts\r\n ```\r\n \r\n
2. Go to the following path -
`x-pack/test/functional/apps/dataset_quality/degraded_field_flyout.ts`\r\n
3. Comment out the 2 `after` blocks present at Line - 54-56 and
414-416\r\n 4. Run the FTR runner using the command below\r\n \r\n
```\r\nyarn test:ftr:runner --config
./x-pack/test/functional/apps/dataset_quality/config.ts --include
./x-pack/test/functional/apps/dataset_quality/degraded_field_flyout.ts\r\n```\r\n\r\nLet
the test run and go green\r\n\r\n5. Navigate to
`http://localhost:5620/app/management/data/data_quality/`\r\nusername -
`test_user` and password - `changeme`\r\n\r\n6. Select the
`degraded.dataset.rca` dataset\r\n\r\nYou will have an environment ready
to test the flyout different\r\nscenarios\r\n\r\n## Demo\r\n\r\n## Field
Limit and Ignore above isse\r\n\r\n![Field
Limit\r\nIssue](https://github.com/user-attachments/assets/5908f1a8-ed85-455b-8f61-894b2fc6bb1c)\r\n\r\n##
Warning about not current quality issue\r\n\r\n![Current
Quality\r\nIssue](https://github.com/user-attachments/assets/1dd6278f-75f8-4715-bd83-8ac9784afbf7)\r\n\r\n##
Blocker\r\n\r\nThere is an Elasticsearch issue on Serverless, which
becomes a blocker\r\nfor merging this
PR\r\n\r\nhttps://github.com/elastic/elasticsearch-serverless/issues/2815","sha":"0d19367fdfad5526b5220dfdf18b4991fe6b3abd"}}]}]
BACKPORT-->

Co-authored-by: Achyut Jhunjhunwala <[email protected]>
  • Loading branch information
kibanamachine and achyutjhunjhunwala authored Oct 4, 2024
1 parent 268e07f commit 29be4a5
Show file tree
Hide file tree
Showing 58 changed files with 2,280 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ export interface DataQualityDetailsLocatorParams extends SerializableRecord {
table?: DegradedFieldsTable;
};
expandedDegradedField?: string;
showCurrentQualityIssues?: boolean;
}
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pageLoadAssetSize:
dashboardEnhanced: 65646
data: 454087
dataQuality: 19384
datasetQuality: 52000
datasetQuality: 55000
dataUsage: 30000
dataViewEditor: 28082
dataViewFieldEditor: 42021
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"settings": {
"index": {
"codec": "best_compression",
"final_pipeline": "logs@custom",
"mapping": {
"total_fields": {
"limit": 2000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"settings": {
"index": {
"final_pipeline": "logs@custom",
"codec": "best_compression",
"mapping": {
"total_fields": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
},
"settings": {
"index": {
"final_pipeline": "logs@custom",
"codec": "best_compression",
"mapping": {
"total_fields": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"settings": {
"index": {
"final_pipeline": "logs@custom",
"codec": "best_compression",
"mapping": {
"total_fields": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
},
"settings": {
"index": {
"final_pipeline": "logs@custom",
"codec": "best_compression",
"mapping": {
"total_fields": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
},
"settings": {
"index": {
"final_pipeline": "logs@custom",
"codec": "best_compression",
"mapping": {
"total_fields": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"settings": {
"index": {
"final_pipeline": "logs@custom",
"codec": "best_compression",
"mapping": {
"total_fields": {
Expand Down
2 changes: 0 additions & 2 deletions x-pack/packages/kbn-data-forge/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import { installAssets } from './lib/install_assets';
import { indexSchedule } from './lib/index_schedule';
import { installIndexTemplate } from './lib/install_index_template';
import { indices } from './lib/indices';
import { installDefaultIngestPipeline } from './lib/install_default_ingest_pipeline';
import { installDefaultComponentTemplate } from './lib/install_default_component_template';

export async function run(config: Config, client: Client, logger: ToolingLog) {
await installDefaultComponentTemplate(config, client, logger);
await installDefaultIngestPipeline(config, client, logger);
await installIndexTemplate(config, client, logger);
if (config.elasticsearch.installKibanaUser) {
await setupKibanaSystemUser(config, client, logger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const urlSchemaRT = rt.exact(
breakdownField: rt.string,
degradedFields: degradedFieldRT,
expandedDegradedField: rt.string,
showCurrentQualityIssues: rt.boolean,
}),
])
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const getStateFromUrlValue = (
degradedFields: urlValue.degradedFields,
breakdownField: urlValue.breakdownField,
expandedDegradedField: urlValue.expandedDegradedField,
showCurrentQualityIssues: urlValue.showCurrentQualityIssues,
});

export const getUrlValueFromState = (
Expand All @@ -30,6 +31,7 @@ export const getUrlValueFromState = (
degradedFields: state.degradedFields,
breakdownField: state.breakdownField,
expandedDegradedField: state.expandedDegradedField,
showCurrentQualityIssues: state.showCurrentQualityIssues,
v: 1,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The deployment-agnostic API tests are located in [`x-pack/test/api_integration/d
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts

# run tests
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep=$
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --include ./x-pack/test/api_integration/deployment_agnostic/apis/observability/dataset_quality/$
```

#### Start server and run test (serverless)
Expand All @@ -39,7 +39,7 @@ node scripts/functional_test_runner --config x-pack/test/api_integration/deploym
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

# run tests
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep=$
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --include ./x-pack/test/api_integration/deployment_agnostic/apis/observability/dataset_quality/$
```

### API integration tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const degradedFieldRt = rt.type({
y: rt.number,
})
),
indexFieldWasLastPresentIn: rt.string,
});

export type DegradedField = rt.TypeOf<typeof degradedFieldRt>;
Expand All @@ -120,11 +121,34 @@ export const degradedFieldValuesRt = rt.type({

export type DegradedFieldValues = rt.TypeOf<typeof degradedFieldValuesRt>;

export const dataStreamSettingsRt = rt.partial({
createdOn: rt.union([rt.null, rt.number]), // rt.null is needed because `createdOn` is not available on Serverless
integration: rt.string,
datasetUserPrivileges: datasetUserPrivilegesRt,
});
export const degradedFieldAnalysisRt = rt.intersection([
rt.type({
isFieldLimitIssue: rt.boolean,
fieldCount: rt.number,
totalFieldLimit: rt.number,
}),
rt.partial({
ignoreMalformed: rt.boolean,
nestedFieldLimit: rt.number,
fieldMapping: rt.partial({
type: rt.string,
ignore_above: rt.number,
}),
}),
]);

export type DegradedFieldAnalysis = rt.TypeOf<typeof degradedFieldAnalysisRt>;

export const dataStreamSettingsRt = rt.intersection([
rt.type({
lastBackingIndexName: rt.string,
}),
rt.partial({
createdOn: rt.union([rt.null, rt.number]), // rt.null is needed because `createdOn` is not available on Serverless
integration: rt.string,
datasetUserPrivileges: datasetUserPrivilegesRt,
}),
]);

export type DataStreamSettings = rt.TypeOf<typeof dataStreamSettingsRt>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
export interface GetDataStreamIntegrationParams {
integrationName: string;
}

export interface AnalyzeDegradedFieldsParams {
dataStream: string;
lastBackingIndex: string;
degradedField: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

export const _IGNORED = '_ignored';
export const TIMESTAMP = '@timestamp';
export const INDEX = '_index';

export const DATA_STREAM_DATASET = 'data_stream.dataset';
export const DATA_STREAM_NAMESPACE = 'data_stream.namespace';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,24 @@ export const openInLogsExplorerText = i18n.translate(
}
);

export const logsExplorerAriaText = i18n.translate(
'xpack.datasetQuality.details.logsExplorerAriaText',
{
defaultMessage: 'Logs Explorer',
}
);

export const openInDiscoverText = i18n.translate(
'xpack.datasetQuality.details.openInDiscoverText',
{
defaultMessage: 'Open in Discover',
}
);

export const discoverAriaText = i18n.translate('xpack.datasetQuality.details.discoverAriaText', {
defaultMessage: 'Discover',
});

export const flyoutDatasetDetailsText = i18n.translate(
'xpack.datasetQuality.flyoutDatasetDetailsText',
{
Expand Down Expand Up @@ -329,6 +340,21 @@ export const overviewDegradedFieldsSectionTitle = i18n.translate(
}
);

export const overviewDegradedFieldToggleSwitch = i18n.translate(
'xpack.datasetQuality.details.degradedFieldToggleSwitch',
{
defaultMessage: 'Current quality issues only',
}
);

export const overviewDegradedFieldToggleSwitchTooltip = i18n.translate(
'xpack.datasetQuality.details.degradedFieldToggleSwitchTooltip',
{
defaultMessage:
'Enable to only show issues detected in the most recent version of the data set. Disable to show all issues detected within the configured time range.',
}
);

export const overviewDegradedFieldsSectionTitleTooltip = i18n.translate(
'xpack.datasetQuality.details.degradedFieldsSectionTooltip',
{
Expand Down Expand Up @@ -402,3 +428,75 @@ export const fieldIgnoredText = i18n.translate(
defaultMessage: 'field ignored',
}
);

export const degradedFieldPotentialCauseColumnName = i18n.translate(
'xpack.datasetQuality.details.degradedField.potentialCause',
{
defaultMessage: 'Potential cause',
}
);

export const degradedFieldCurrentFieldLimitColumnName = i18n.translate(
'xpack.datasetQuality.details.degradedField.currentFieldLimit',
{
defaultMessage: 'Field limit',
}
);

export const degradedFieldMaximumCharacterLimitColumnName = i18n.translate(
'xpack.datasetQuality.details.degradedField.maximumCharacterLimit',
{
defaultMessage: 'Maximum character length',
}
);

export const degradedFieldCauseFieldLimitExceeded = i18n.translate(
'xpack.datasetQuality.details.degradedField.cause.fieldLimitExceeded',
{
defaultMessage: 'field limit exceeded',
}
);

export const degradedFieldCauseFieldLimitExceededTooltip = i18n.translate(
'xpack.datasetQuality.details.degradedField.cause.fieldLimitExceededTooltip',
{
defaultMessage: 'The number of fields in this index has exceeded the maximum allowed limit.',
}
);

export const degradedFieldCauseFieldIgnored = i18n.translate(
'xpack.datasetQuality.details.degradedField.cause.fieldIgnored',
{
defaultMessage: 'field character limit exceeded',
}
);

export const degradedFieldCauseFieldIgnoredTooltip = i18n.translate(
'xpack.datasetQuality.details.degradedField.cause.fieldIgnoredTooltip',
{
defaultMessage:
'One or more values for this field exceeded the maximum allowed character length. Characters above will be ignored.',
}
);

export const degradedFieldCauseFieldMalformed = i18n.translate(
'xpack.datasetQuality.details.degradedField.cause.fieldMalformed',
{
defaultMessage: 'field malformed',
}
);

export const degradedFieldCauseFieldMalformedTooltip = i18n.translate(
'xpack.datasetQuality.details.degradedField.cause.fieldMalformedTooltip',
{
defaultMessage: 'Data type for the field not set correctly.',
}
);

export const degradedFieldMessageIssueDoesNotExistInLatestIndex = i18n.translate(
'xpack.datasetQuality.details.degradedField.message.issueDoesNotExistInLatestIndex',
{
defaultMessage:
'This issue was detected in an older version of the dataset, but not in the most recent version.',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DegradedFieldFlyout = dynamic(() => import('./degraded_field_flyout'));
// Allow for lazy loading
// eslint-disable-next-line import/no-default-export
export default function DatasetQualityDetails() {
const { isIndexNotFoundError, dataStream, expandedDegradedField } =
const { isIndexNotFoundError, dataStream, isDegradedFieldFlyoutOpen } =
useDatasetQualityDetailsState();
const { startTracking } = useDatasetDetailsTelemetry();

Expand All @@ -38,7 +38,7 @@ export default function DatasetQualityDetails() {
<Details />
</EuiFlexItem>
</EuiFlexGroup>
{expandedDegradedField && <DegradedFieldFlyout />}
{isDegradedFieldFlyoutOpen && <DegradedFieldFlyout />}
</>
);
}
Loading

0 comments on commit 29be4a5

Please sign in to comment.