Skip to content

[8.17](backport #45008) [OTel] Support Serializing nested data#45024

Closed
mergify[bot] wants to merge 1 commit into8.17from
mergify/bp/8.17/pr-45008
Closed

[8.17](backport #45008) [OTel] Support Serializing nested data#45024
mergify[bot] wants to merge 1 commit into8.17from
mergify/bp/8.17/pr-45008

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented 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.

Proposed commit message

Properly handles nested map[string]any and array types (not just slices) for OTel conversion to avoid Invalid type warnings from OTel.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

This should make the code more flexible -- not less.

Author's Checklist

  • Ensure nested types are serialized.

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

Use cases

Metricsets can now ship nested map[string]any that contain arrays and slices, including of []map[string]any.


This is an automatic backport of pull request #45008 done by Mergify.

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 mergify Bot requested a review from a team as a code owner June 25, 2025 11:27
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Jun 25, 2025
@mergify mergify Bot requested review from leehinman and mauri870 and removed request for a team June 25, 2025 11:27
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 25, 2025
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Jun 25, 2025

Cherry-pick of 7bfa78e has failed:

On branch mergify/bp/8.17/pr-45008
Your branch is up to date with 'origin/8.17'.

You are currently cherry-picking commit 7bfa78e27.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG-developer.next.asciidoc

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   libbeat/otelbeat/otelmap/otelmap.go
	deleted by us:   libbeat/otelbeat/otelmap/otelmap_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic
Copy link
Copy Markdown

botelastic Bot commented Jun 25, 2025

This pull request doesn't have a Team:<team> label.

@mergify mergify Bot mentioned this pull request Jun 25, 2025
7 tasks
@pickypg
Copy link
Copy Markdown
Member

pickypg commented Jun 25, 2025

Code not in 8.17.

@pickypg pickypg closed this Jun 25, 2025
@pickypg pickypg deleted the mergify/bp/8.17/pr-45008 branch June 25, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant