elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.62k stars 24.64k forks source link

Fix LogsDB sort field for OTel data streams #113397

Open felixbarny opened 3 hours ago

felixbarny commented 3 hours ago

We're using LogsDB for OTel logs and traces data streams and have customized the sort fields to use resource.attributes.host.name instead of host.name:

https://github.com/elastic/elasticsearch/blob/3d201e1159654088f5934f24fa7609594da8144a/x-pack/plugin/otel-data/src/main/resources/component-templates/logs-otel%40mappings.yaml#L6-L11

https://github.com/elastic/elasticsearch/blob/3d201e1159654088f5934f24fa7609594da8144a/x-pack/plugin/otel-data/src/main/resources/component-templates/traces-otel%40mappings.yaml#L6-L11

We forgot to also add the @timestamp field to that list, which is used by the default configuration in LogsDB.

https://github.com/elastic/elasticsearch/blob/5750696069ef85be658c214a5d6281d083bd977c/server/src/main/java/org/elasticsearch/index/IndexSortConfig.java#L149-L151

elasticsearchmachine commented 3 hours ago

Pinging @elastic/es-storage-engine (Team:StorageEngine)