Skip to content

[9.0](backport #45076) [OTel] Convert []any-nested mapstr.M#45081

Merged
pickypg merged 1 commit into9.0from
mergify/bp/9.0/pr-45076
Jun 27, 2025
Merged

[9.0](backport #45076) [OTel] Convert []any-nested mapstr.M#45081
pickypg merged 1 commit into9.0from
mergify/bp/9.0/pr-45076

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jun 26, 2025

This adds the reflective capture of mapstr.M in addition to map[string]any for []any.

I noticed, at runtime, the cat_shards metricset produces mapstr.M in a nested array even though the autoops_es code does not produce it that way, libbeat does:

case reflect.Map, reflect.Struct:
var m mapstr.M
err := marshalUnmarshal(value, &m)
if err != nil {
return m, []error{fmt.Errorf("key=%v: error converting %T to mapstr.M: %w", joinKeys(keys...), value, err)}
}
return m, nil

Proposed commit message

Convert inner slice/array mapstr.M to map[string]any.

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

None. This improves compatibility.

Author's Checklist

  • Validate tests.

How to test this PR locally

Run the Elastic Agent with autoops_es

Related issues

@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Jun 26, 2025
@mergify mergify Bot requested a review from a team as a code owner June 26, 2025 22:13
@mergify mergify Bot added the backport label Jun 26, 2025
@mergify

This comment was marked as resolved.

@mergify mergify Bot added the conflicts There is a conflict in the backported pull request label Jun 26, 2025
@mergify mergify Bot requested review from andrzej-stencel and faec and removed request for a team June 26, 2025 22:13
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 26, 2025
@github-actions github-actions Bot added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jun 26, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 26, 2025
@pickypg
Copy link
Copy Markdown
Member

pickypg commented Jun 26, 2025

Conflict requires: #45044

This adds the reflective capture of `mapstr.M` in addition to
`map[string]any` for `[]any`.
@pickypg pickypg force-pushed the mergify/bp/9.0/pr-45076 branch from 2a285de to d613cdc Compare June 27, 2025 17:17
@pickypg pickypg merged commit eba800e into 9.0 Jun 27, 2025
175 checks passed
@pickypg pickypg deleted the mergify/bp/9.0/pr-45076 branch June 27, 2025 19:07
@pickypg pickypg removed the conflicts There is a conflict in the backported pull request label Jun 27, 2025
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.

2 participants