[exporter/opensearchexporter] Prevent dotted-attribute mapping conflicts - #50953
Draft
singhvibhanshu wants to merge 1 commit into
Draft
[exporter/opensearchexporter] Prevent dotted-attribute mapping conflicts#50953singhvibhanshu wants to merge 1 commit into
singhvibhanshu wants to merge 1 commit into
Conversation
Signed-off-by: singhvibhanshu <find.vibhanshu@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR prevents dotted-attribute mapping conflicts in the OpenSearch exporter.
OpenSearch expands dots in JSON field names into nested objects during dynamic mapping. OTel attributes are a flat namespace, so an attribute map containing both a concrete key (e.g.
code.function) and a longer key that uses it as an object prefix (e.g.code.function.name) made OpenSearch try to mapattributes.code.functionas both a value and an object, rejecting the document with amapper_parsing_exception. This commonly happens while migrating between semantic-convention versions.The conflict is resolved in two complementary ways:
.valuesub-key (code.functionbecomescode.function.value) for span, event, link, log-record, metric data-point, exemplar and instrumentation-scope attributes in the ss4o and otel-v1 mapping modes. Only documents OpenSearch would otherwise reject are changed.mapping.manage_index_templateis now supported in ss4o mode, installing traces and logs index templates that map attribute bags asflat_objectso OpenSearch stops expanding dotted attribute keys. This deterministically avoids conflicts across documents. Sinceflat_objectindexes values as strings, the option is opt-in and defaults to false.Link to tracking issue
Fixes #47465
Testing
Tuned.
Documentation
Tuned.
Authorship