-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dataset Quality] Fix failing test on mki qa (#196122)
## Summary Closes #195466 As LogDB mode is enabled on MKI QA environment, it causes mappings for certain fields like `host.name` to be set differently. Hence causing tests to fail. As part of the fix, before ingesting data, i am statically setting the mappings so that it does not cause any collision with something outside the scope of the tests (cherry picked from commit 7237902) # Conflicts: # x-pack/test/api_integration/deployment_agnostic/apis/observability/dataset_quality/degraded_field_analyze.ts # x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts
- Loading branch information
1 parent
db599d1
commit b9622ef
Showing
7 changed files
with
455 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
...ment_agnostic/apis/observability/dataset_quality/custom_mappings/custom_synth_mappings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types'; | ||
|
||
export const logsSynthMappings = (dataset: string): MappingTypeMapping => ({ | ||
properties: { | ||
'@timestamp': { | ||
type: 'date', | ||
ignore_malformed: false, | ||
}, | ||
data_stream: { | ||
properties: { | ||
dataset: { | ||
type: 'constant_keyword', | ||
value: dataset, | ||
}, | ||
namespace: { | ||
type: 'constant_keyword', | ||
value: 'default', | ||
}, | ||
type: { | ||
type: 'constant_keyword', | ||
value: 'logs', | ||
}, | ||
}, | ||
}, | ||
event: { | ||
properties: { | ||
dataset: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
}, | ||
}, | ||
host: { | ||
properties: { | ||
name: { | ||
type: 'keyword', | ||
fields: { | ||
text: { | ||
type: 'match_only_text', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
input: { | ||
properties: { | ||
type: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
}, | ||
}, | ||
log: { | ||
properties: { | ||
file: { | ||
properties: { | ||
path: { | ||
type: 'keyword', | ||
fields: { | ||
text: { | ||
type: 'match_only_text', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
message: { | ||
type: 'match_only_text', | ||
}, | ||
network: { | ||
properties: { | ||
bytes: { | ||
type: 'long', | ||
}, | ||
}, | ||
}, | ||
service: { | ||
properties: { | ||
name: { | ||
type: 'keyword', | ||
fields: { | ||
text: { | ||
type: 'match_only_text', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
test_field: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
tls: { | ||
properties: { | ||
established: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
x-pack/test/functional/apps/dataset_quality/custom_mappings/custom_synth_mappings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types'; | ||
|
||
export const logsSynthMappings = (dataset: string): MappingTypeMapping => ({ | ||
properties: { | ||
'@timestamp': { | ||
type: 'date', | ||
ignore_malformed: false, | ||
}, | ||
data_stream: { | ||
properties: { | ||
dataset: { | ||
type: 'constant_keyword', | ||
value: 'degraded.dataset.rca', | ||
}, | ||
namespace: { | ||
type: 'constant_keyword', | ||
value: 'default', | ||
}, | ||
type: { | ||
type: 'constant_keyword', | ||
value: 'logs', | ||
}, | ||
}, | ||
}, | ||
event: { | ||
properties: { | ||
dataset: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
}, | ||
}, | ||
host: { | ||
properties: { | ||
name: { | ||
type: 'keyword', | ||
fields: { | ||
text: { | ||
type: 'match_only_text', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
input: { | ||
properties: { | ||
type: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
}, | ||
}, | ||
log: { | ||
properties: { | ||
level: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
}, | ||
}, | ||
message: { | ||
type: 'match_only_text', | ||
}, | ||
network: { | ||
properties: { | ||
bytes: { | ||
type: 'long', | ||
}, | ||
}, | ||
}, | ||
service: { | ||
properties: { | ||
name: { | ||
type: 'keyword', | ||
fields: { | ||
text: { | ||
type: 'match_only_text', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
test_field: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
tls: { | ||
properties: { | ||
established: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
}, | ||
trace: { | ||
properties: { | ||
id: { | ||
type: 'keyword', | ||
ignore_above: 1024, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.