[OTel] Support Serializing nested data#45008
Merged
Conversation
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
Added Vihas as a reviewer because of his recent work on otelmap. |
Contributor
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
mauri870
approved these changes
Jun 24, 2025
Member
mauri870
left a comment
There was a problem hiding this comment.
Thanks for fixing this. I don’t see anything obviously out of place. The recursion in certain use cases definitely makes it harder to wrap your head around all the possible scenarios.
Please wait for at least another review.
7 tasks
pickypg
commented
Jun 24, 2025
Member
Author
No problem waiting. I am marking as auto-merge since after your review it's not going to do it on its own so that it can end up in the nightly build on the next pass. |
VihasMakwana
approved these changes
Jun 25, 2025
Contributor
|
@Mergifyio backport 8.17 8.18 8.19 9.0 |
Contributor
✅ Backports have been createdDetails
|
mergify Bot
pushed a commit
that referenced
this pull request
Jun 25, 2025
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code. (cherry picked from commit 7bfa78e) # Conflicts: # libbeat/otelbeat/otelmap/otelmap.go # libbeat/otelbeat/otelmap/otelmap_test.go
mergify Bot
pushed a commit
that referenced
this pull request
Jun 25, 2025
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code. (cherry picked from commit 7bfa78e)
mergify Bot
pushed a commit
that referenced
this pull request
Jun 25, 2025
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code. (cherry picked from commit 7bfa78e) # Conflicts: # libbeat/otelbeat/otelmap/otelmap.go # libbeat/otelbeat/otelmap/otelmap_test.go
This was referenced Jun 25, 2025
mergify Bot
pushed a commit
that referenced
this pull request
Jun 25, 2025
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code. (cherry picked from commit 7bfa78e)
7 tasks
pickypg
added a commit
that referenced
this pull request
Jun 25, 2025
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code. (cherry picked from commit 7bfa78e) Co-authored-by: Chris Earle <pickypg@users.noreply.github.com>
pickypg
added a commit
that referenced
this pull request
Jun 25, 2025
This adds support for `map[string]any` and also arrays in general (as opposed to just slices) to the converted map. Like `mapstr.M` and `[]mapstr.M`, this will dive into the `map[string]any` and `[]map[string]any` objects to ensure that they are properly converted for the pdata code. (cherry picked from commit 7bfa78e) Co-authored-by: Chris Earle <pickypg@users.noreply.github.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.
This adds support for
map[string]anyand also arrays in general (as opposed to just slices) to the converted map.Like
mapstr.Mand[]mapstr.M, this will dive into themap[string]anyand[]map[string]anyobjects to ensure that they are properly converted for the pdata code.Proposed commit message
Properly handles nested
map[string]anyand array types (not just slices) for OTel conversion to avoidInvalid typewarnings from OTel.Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
This should make the code more flexible -- not less.
Author's Checklist
How to test this PR locally
The easiest way is to inspect the new test and try removing the updated code to see what changes.
Related issues
[]any#45007Use cases
Metricsets can now ship nested
map[string]anythat contain arrays and slices, including of[]map[string]any.