Skip to content

Commit

Permalink
[Lens][LogsDB] Add test suite (elastic#194031)
Browse files Browse the repository at this point in the history
## Summary

Test suite for LogsDB in Kibana

Adding tests for the following scenarios:
* [x] All Lens operations (aggs) should work fine with a LogsDB stream
* Mixed index scenarios
  * [x] LogsDB stream (upgraded from regular stream)
  * [x] LogsDB stream without `host.name` field in the mapping
  * [x] LogsDB stream (upgraded from regular stream) + regular index
  * [x] LogsDB stream (upgraded from regular stream) + TSDB stream
* [x] LogsDB stream (upgraded from regular stream) + another LogsDB
stream
* [x] LogsDB stream (upgraded from regular stream) + TSDB stream
downsampled
  * [x] Data stream (downgraded from LogsDB stream)
  * [x] Data stream without `host.name` field in the mapping
  * [x] Data stream (downgraded from LogsDB stream) + regular index
  * [x] Data stream (downgraded from LogsDB stream) + TSDB stream
* [x] Data stream (downgraded from LogsDB stream) + another LogsDB
stream
* [x] Data stream (downgraded from LogsDB stream) + TSDB stream
downsampled

For the mixed scenario suite the following tests are performed:
* Create a date histogram vs `count(bytes)`
  * same test but using the `utc_time` field rather than `@timestamp`
* Create a chart with an annotation layer
* same test but using the `utc_time` for both data and annotation layer
* use the `host.name`, `utc_time`, `@timestamp` as extra field in the
annotation tooltip
* Create a visualization with ES|QL using `STATS`

---------

Co-authored-by: dej611 <[email protected]>
  • Loading branch information
markov00 and dej611 authored Oct 1, 2024
1 parent c4e2a72 commit 34fb654
Show file tree
Hide file tree
Showing 12 changed files with 2,552 additions and 933 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"type": "index",
"value": {
"aliases": {},
"index": "kibana_sample_data_logslogsdb",
"mappings": {
"_data_stream_timestamp": {
"enabled": true
},
"properties": {
"@timestamp": {
"type": "date"
},
"agent": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"bytes": {
"type": "long"
},
"bytes_counter": {
"time_series_metric": "counter",
"type": "long"
},
"bytes_gauge": {
"time_series_metric": "gauge",
"type": "long"
},
"clientip": {
"type": "ip"
},
"event": {
"properties": {
"dataset": {
"type": "keyword"
}
}
},
"extension": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"geo": {
"properties": {
"coordinates": {
"type": "geo_point"
},
"dest": {
"type": "keyword"
},
"src": {
"type": "keyword"
},
"srcdest": {
"type": "keyword"
}
}
},
"host": {
"properties": {
"name": {
"type": "keyword"
}
}
},
"index": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"ip": {
"type": "ip"
},
"machine": {
"properties": {
"os": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"ram": {
"type": "long"
}
}
},
"memory": {
"type": "double"
},
"message": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"phpmemory": {
"type": "long"
},
"referer": {
"type": "keyword"
},
"request": {
"time_series_dimension": true,
"type": "keyword"
},
"response": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"tags": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"timestamp": {
"path": "@timestamp",
"type": "alias"
},
"url": {
"time_series_dimension": true,
"type": "keyword"
},
"utc_time": {
"type": "date"
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mode": "time_series",
"number_of_replicas": "0",
"number_of_shards": "1",
"routing_path": "request",
"time_series": {
"end_time": "2023-06-28T09:17:00.283Z",
"start_time": "2023-03-28T09:17:00.283Z"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"attributes": {
"fieldFormatMap": "{\"hour_of_day\":{}}",
"name": "Kibana Sample Data Logs (LogsDB)",
"runtimeFieldMap": "{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}",
"timeFieldName": "timestamp",
"title": "kibana_sample_data_logslogsdb"
},
"coreMigrationVersion": "8.8.0",
"created_at": "2023-04-27T13:09:20.333Z",
"id": "90943e30-9a47-11e8-b64d-95841ca0c247",
"managed": false,
"references": [],
"sort": [
1682600960333,
64
],
"type": "index-pattern",
"typeMigrationVersion": "7.11.0",
"updated_at": "2023-04-27T13:09:20.333Z",
"version": "WzIxLDFd"
}
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/lens/group4/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext
loadTestFile(require.resolve('./share')); // 1m 20s
// keep it last in the group
loadTestFile(require.resolve('./tsdb')); // 1m
loadTestFile(require.resolve('./logsdb')); // 1m
});
};
Loading

0 comments on commit 34fb654

Please sign in to comment.