[ML] Functional tests - add apm_transaction module tests (#115011) (#118370)

This PR adds/updates module recognizer and setup tests for the `apm_transaction` module as well as a corresponding esArchive.

Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
This commit is contained in:
Kibana Machine 2021-11-11 11:52:50 -05:00 committed by GitHub
parent b49687afe7
commit e0baae4cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 517 additions and 8 deletions

View file

@ -202,6 +202,16 @@ export default ({ getService }: FtrProviderContext) => {
moduleIds: ['nginx_data_stream'],
},
},
{
testTitleSuffix: 'for apm transaction dataset',
sourceDataArchive: 'x-pack/test/functional/es_archives/ml/module_apm_transaction',
indexPattern: 'ft_module_apm_transaction',
user: USER.ML_POWERUSER,
expected: {
responseCode: 200,
moduleIds: ['apm_transaction'],
},
},
];
async function executeRecognizeModuleRequest(indexPattern: string, user: USER, rspCode: number) {

View file

@ -187,20 +187,18 @@ export default ({ getService }: FtrProviderContext) => {
dashboards: [] as string[],
},
},
// Set startDatafeed and estimateModelMemory to false for the APM transaction test
// until there is a new data set available with metric data.
{
testTitleSuffix:
'for apm_transaction with prefix, startDatafeed false and estimateModelMemory false',
sourceDataArchive: 'x-pack/test/functional/es_archives/ml/module_apm',
indexPattern: { name: 'ft_module_apm', timeField: '@timestamp' },
'for apm_transaction with prefix, startDatafeed true and estimateModelMemory true',
sourceDataArchive: 'x-pack/test/functional/es_archives/ml/module_apm_transaction',
indexPattern: { name: 'ft_module_apm_transaction', timeField: '@timestamp' },
module: 'apm_transaction',
user: USER.ML_POWERUSER,
requestBody: {
prefix: 'pf5_',
indexPatternName: 'ft_module_apm',
startDatafeed: false,
estimateModelMemory: false,
indexPatternName: 'ft_module_apm_transaction',
startDatafeed: true,
end: Date.now(),
},
expected: {
responseCode: 200,

View file

@ -0,0 +1,501 @@
{
"type": "index",
"value": {
"aliases": {
},
"index": "ft_module_apm_transaction",
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"agent": {
"properties": {
"name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"ecs": {
"properties": {
"version": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"event": {
"properties": {
"action": {
"ignore_above": 1024,
"type": "keyword"
},
"category": {
"ignore_above": 1024,
"type": "keyword"
},
"code": {
"ignore_above": 1024,
"type": "keyword"
},
"created": {
"type": "date"
},
"dataset": {
"ignore_above": 1024,
"type": "keyword"
},
"duration": {
"type": "long"
},
"end": {
"type": "date"
},
"hash": {
"ignore_above": 1024,
"type": "keyword"
},
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"ingested": {
"type": "date"
},
"kind": {
"ignore_above": 1024,
"type": "keyword"
},
"module": {
"ignore_above": 1024,
"type": "keyword"
},
"original": {
"ignore_above": 1024,
"index": false,
"type": "keyword"
},
"outcome": {
"ignore_above": 1024,
"type": "keyword"
},
"provider": {
"ignore_above": 1024,
"type": "keyword"
},
"reason": {
"ignore_above": 1024,
"type": "keyword"
},
"reference": {
"ignore_above": 1024,
"type": "keyword"
},
"risk_score": {
"type": "float"
},
"risk_score_norm": {
"type": "float"
},
"sequence": {
"type": "long"
},
"severity": {
"type": "long"
},
"start": {
"type": "date"
},
"timezone": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
},
"url": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"host": {
"properties": {
"hostname": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"metricset": {
"properties": {
"name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"observer": {
"properties": {
"ephemeral_id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"hostname": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"type": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"version": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"version_major": {
"type": "long"
}
}
},
"processor": {
"properties": {
"event": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"service": {
"dynamic": "false",
"properties": {
"environment": {
"ignore_above": 1024,
"type": "keyword"
},
"ephemeral_id": {
"ignore_above": 1024,
"type": "keyword"
},
"framework": {
"properties": {
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"language": {
"properties": {
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"node": {
"properties": {
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"runtime": {
"properties": {
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"state": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"timeseries": {
"properties": {
"instance": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"transaction": {
"properties": {
"breakdown": {
"properties": {
"count": {
"type": "long"
}
}
},
"duration": {
"properties": {
"count": {
"type": "long"
},
"histogram": {
"type": "histogram"
},
"sum": {
"properties": {
"us": {
"meta": {
"unit": "micros"
},
"type": "long"
}
}
},
"us": {
"type": "long"
}
}
},
"experience": {
"properties": {
"cls": {
"scaling_factor": 1000000,
"type": "scaled_float"
},
"fid": {
"scaling_factor": 1000000,
"type": "scaled_float"
},
"longtask": {
"properties": {
"count": {
"type": "long"
},
"max": {
"scaling_factor": 1000000,
"type": "scaled_float"
},
"sum": {
"scaling_factor": 1000000,
"type": "scaled_float"
}
}
},
"tbt": {
"scaling_factor": 1000000,
"type": "scaled_float"
}
}
},
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"marks": {
"dynamic": "true",
"properties": {
"*": {
"properties": {
"*": {
"dynamic": "true",
"type": "object"
}
}
}
}
},
"message": {
"dynamic": "false",
"properties": {
"age": {
"properties": {
"ms": {
"type": "long"
}
}
},
"queue": {
"properties": {
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
},
"name": {
"fields": {
"text": {
"norms": false,
"type": "text"
}
},
"ignore_above": 1024,
"type": "keyword"
},
"result": {
"ignore_above": 1024,
"type": "keyword"
},
"root": {
"type": "boolean"
},
"sampled": {
"type": "boolean"
},
"self_time": {
"properties": {
"count": {
"type": "long"
},
"sum": {
"properties": {
"us": {
"meta": {
"unit": "micros"
},
"type": "long"
}
}
}
}
},
"span_count": {
"properties": {
"dropped": {
"type": "long"
}
}
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
},
"settings": {
"index": {
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}