Skip to content

Commit

Permalink
Ingest event.dataset beforehand in field limit tests as new version…
Browse files Browse the repository at this point in the history
… of ES ingests it itself making the tests fail.
  • Loading branch information
awahab07 committed Dec 27, 2024
1 parent 8e0561a commit de85439
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
4 changes: 4 additions & 0 deletions x-pack/test/functional/apps/dataset_quality/data/logs_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,7 @@ export const MORE_THAN_1024_CHARS =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?';
export const ANOTHER_1024_CHARS =
'grape fig tangerine tangerine kiwi lemon papaya cherry nectarine papaya mango cherry nectarine fig cherry fig grape mango mango quince fig strawberry mango quince date kiwi quince raspberry apple kiwi banana quince fig papaya grape mango cherry banana mango cherry lemon cherry tangerine fig quince quince papaya tangerine grape strawberry banana kiwi grape mango papaya nectarine banana nectarine kiwi papaya lemon apple lemon orange fig cherry grape apple nectarine papaya orange fig papaya date mango papaya mango cherry tangerine papaya apple banana papaya cherry strawberry grape raspberry lemon date papaya mango kiwi cherry fig banana banana apple date strawberry mango tangerine date lemon kiwi quince date orange orange papaya date apple fig tangerine quince tangerine date papaya banana banana orange raspberry papaya apple nectarine lemon raspberry raspberry mango cherry kiwi cherry cherry nectarine cherry date strawberry banana orange mango mango tangerine quince papaya papaya kiwi papaya strawberry date mango';

export const CONSISTENT_TAGS = [
'this_is_here_to_remove_variance_introduced_by_the_geoip_processor',
];
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getInitialTestLogs,
ANOTHER_1024_CHARS,
MORE_THAN_1024_CHARS,
CONSISTENT_TAGS,
} from './data';
import { logsSynthMappings } from './custom_mappings/custom_synth_mappings';
import { logsNginxMappings } from './custom_mappings/custom_integration_mappings';
Expand Down Expand Up @@ -187,7 +188,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
.timestamp(timestamp)
);
}),
// Ingest Degraded Logs with 26 fields in Apm DataSet
// Ingest Degraded Logs with 27 fields in Apm DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand All @@ -205,7 +206,9 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
.defaults({
'service.name': serviceName,
'trace.id': generateShortId(),
'event.ingested': new Date().toISOString(),
test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS],
tags: CONSISTENT_TAGS, // To account for ES inserted error tags
})
.timestamp(timestamp)
);
Expand All @@ -227,7 +230,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid

// Set Limit of 26
await PageObjects.datasetQuality.setDataStreamSettings(apmAppDataStreamName, {
'mapping.total_fields.limit': 25,
'mapping.total_fields.limit': 26,
});

await synthtrace.index([
Expand Down Expand Up @@ -279,7 +282,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
.timestamp(timestamp)
);
}),
// Ingest Degraded Logs with 27 fields in Apm APP DataSet
// Ingest Degraded Logs with 29 fields in Apm APP DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand All @@ -299,6 +302,8 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
'trace.id': generateShortId(),
test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS],
'cloud.project.id': generateShortId(),
'event.ingested': new Date().toISOString(),
tags: CONSISTENT_TAGS, // To account for ES inserted error tags
})
.timestamp(timestamp)
);
Expand Down Expand Up @@ -330,13 +335,13 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
}
);

// Set Limit of 27
// Set Limit of 28
await PageObjects.datasetQuality.setDataStreamSettings(
PageObjects.datasetQuality.generateBackingIndexNameWithoutVersion({
dataset: apmAppDatasetName,
}) + '-000002',
{
'mapping.total_fields.limit': 27,
'mapping.total_fields.limit': 28,
}
);

Expand Down Expand Up @@ -389,7 +394,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
.timestamp(timestamp)
);
}),
// Ingest Degraded Logs with 27 fields in Apm APP DataSet
// Ingest Degraded Logs with 29 fields in Apm APP DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand All @@ -409,6 +414,8 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
'trace.id': generateShortId(),
test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS],
'cloud.project.id': generateShortId(),
'event.ingested': new Date().toISOString(),
tags: CONSISTENT_TAGS, // To account for ES inserted error tags
})
.timestamp(timestamp)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});

describe('testing root cause for ignored fields', () => {
describe('detecting root cause for ignored fields', () => {
before(async () => {
// Create custom component template
await synthtrace.createComponentTemplate(
Expand Down Expand Up @@ -134,14 +134,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// Install Nginx Integration and ingest logs for it
await PageObjects.observabilityLogsExplorer.installPackage(nginxPkg);

// Create custom component template to avoid issues with LogsDB
// Create custom component template for Nginx to avoid issues with LogsDB
await synthtrace.createComponentTemplate(
customComponentTemplateNameNginx,
logsNginxMappings(nginxAccessDatasetName)
);

await synthtrace.index([
// Ingest Degraded Logs with 25 fields
// Ingest Degraded Logs with 25 fields in degraded DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand Down Expand Up @@ -187,7 +187,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
.timestamp(timestamp)
);
}),
// Ingest Degraded Logs with 26 fields in Apm DataSet
// Ingest Degraded Logs with 27 fields in Apm DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand All @@ -206,6 +206,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'service.name': serviceName,
'trace.id': generateShortId(),
test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS],
'event.ingested': new Date().toISOString(),
// this works around a geoip limitation in CI
tags: CONSISTENT_TAGS,
})
Expand All @@ -229,7 +230,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

// Set Limit of 26
await PageObjects.datasetQuality.setDataStreamSettings(apmAppDataStreamName, {
'mapping.total_fields.limit': 25,
'mapping.total_fields.limit': 26,
});

await synthtrace.index([
Expand Down Expand Up @@ -281,7 +282,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
.timestamp(timestamp)
);
}),
// Ingest Degraded Logs with 27 fields in Apm APP DataSet
// Ingest Degraded Logs with 29 fields in Apm APP DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand All @@ -303,6 +304,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'cloud.project.id': generateShortId(),
// this works around a geoip limitation in CI
tags: CONSISTENT_TAGS,
'event.ingested': new Date().toISOString(),
})
.timestamp(timestamp)
);
Expand Down Expand Up @@ -334,13 +336,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}
);

// Set Limit of 27
// Set Limit of 28
await PageObjects.datasetQuality.setDataStreamSettings(
PageObjects.datasetQuality.generateBackingIndexNameWithoutVersion({
dataset: apmAppDatasetName,
}) + '-000002',
{
'mapping.total_fields.limit': 27,
'mapping.total_fields.limit': 28,
}
);

Expand Down Expand Up @@ -393,7 +395,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
.timestamp(timestamp)
);
}),
// Ingest Degraded Logs with 27 fields in Apm APP DataSet
// Ingest Degraded Logs with 29 fields in Apm APP DataSet
timerange(moment(to).subtract(count, 'minute'), moment(to))
.interval('1m')
.rate(1)
Expand All @@ -413,6 +415,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'trace.id': generateShortId(),
test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS],
'cloud.project.id': generateShortId(),
'event.ingested': new Date().toISOString(),
// this works around a geoip limitation in CI
tags: CONSISTENT_TAGS,
})
Expand Down

0 comments on commit de85439

Please sign in to comment.