Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields with enabled time_series_dimension don't support multi values in non tsdb index modes #112232

Closed
felixbarny opened this issue Aug 27, 2024 · 1 comment · Fixed by #112345
Assignees
Labels
:StorageEngine/Mapping The storage related side of mappings :StorageEngine/TSDB You know, for Metrics Team:StorageEngine

Comments

@felixbarny
Copy link
Member

felixbarny commented Aug 27, 2024

For OTel mappings, we're using a common definition of attributes and resource attributes for logs, metrics, and traces to avoid duplications and ensure a consistent mapping:

attributes:
type: passthrough
dynamic: true
priority: 10
time_series_dimension: true

resource:
properties:
attributes:
type: passthrough
dynamic: true
priority: 30
time_series_dimension: true

That's why we set time_series_dimension to true which I had expected to only kick in for TSDB data streams and ignored for others. However, it seems like a validation gets kicked in which disallows attributes to have multiple values (due to #110387), even in standard and logsdb index modes. As a result, this exception is thrown:

throw new IllegalArgumentException("Dimension field [" + fieldName + "] cannot be a multi-valued field.");

I think the reason for that is that even for IndexMode.STANDARD, we return an implementation of DocumentDimensions that only allows single values:

public DocumentDimensions buildDocumentDimensions(IndexSettings settings) {
return new DocumentDimensions.OnlySingleValueAllowed();
}

Maybe we should return a noop implementation for index modes standard and tsdb? Or silently ignore time_series_dimension when the index mode is not tsdb.

We can also discuss other options for how we can compose our mappings so that multi-valued attributes are allowed for logs and traces while ensure consistency across the mappings and not having to duplicate mappings (in particular the ECS alias mappings, which are quite long)

cc @elastic/obs-ds-intake-services @gregkalapos

@felixbarny felixbarny added :StorageEngine/TSDB You know, for Metrics :StorageEngine/Mapping The storage related side of mappings labels Aug 27, 2024
@elasticsearchmachine
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:StorageEngine/Mapping The storage related side of mappings :StorageEngine/TSDB You know, for Metrics Team:StorageEngine
Projects
None yet
2 participants