Skip to content

[9.0](backport #45008) [OTel] Support Serializing nested data#45027

Merged
pickypg merged 1 commit into
9.0from
mergify/bp/9.0/pr-45008
Jun 25, 2025
Merged

[9.0](backport #45008) [OTel] Support Serializing nested data#45027
pickypg merged 1 commit into
9.0from
mergify/bp/9.0/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)
@mergify mergify Bot added the backport label Jun 25, 2025
@mergify mergify Bot requested a review from a team as a code owner June 25, 2025 11:28
@mergify mergify Bot removed the request for review from a team June 25, 2025 11:28
@mergify mergify Bot requested review from andrzej-stencel and rdner June 25, 2025 11:28
@mergify mergify Bot mentioned this pull request Jun 25, 2025
7 tasks
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 25, 2025
@github-actions github-actions Bot added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jun 25, 2025
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 25, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@pickypg pickypg enabled auto-merge (squash) June 25, 2025 13:23
@pickypg pickypg merged commit 4073417 into 9.0 Jun 25, 2025
178 of 179 checks passed
@pickypg pickypg deleted the mergify/bp/9.0/pr-45008 branch June 25, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants