Skip to content

[8.19](backport #45076) [OTel] Convert []any-nested mapstr.M#45080

Merged
pickypg merged 1 commit into8.19from
mergify/bp/8.19/pr-45076
Jun 27, 2025
Merged

[8.19](backport #45076) [OTel] Convert []any-nested mapstr.M#45080
pickypg merged 1 commit into8.19from
mergify/bp/8.19/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:12
@mergify mergify Bot removed the request for review from a team June 26, 2025 22:12
@mergify mergify Bot added the backport label Jun 26, 2025
@mergify mergify Bot requested review from andrzej-stencel and rdner June 26, 2025 22:12
@mergify mergify Bot added the conflicts There is a conflict in the backported pull request label Jun 26, 2025
@mergify

This comment was marked as resolved.

@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 27, 2025

Conflict requires #45080

This adds the reflective capture of `mapstr.M` in addition to
`map[string]any` for `[]any`.
@pickypg pickypg force-pushed the mergify/bp/8.19/pr-45076 branch from 3113557 to 91d9db0 Compare June 27, 2025 18:05
@pickypg pickypg enabled auto-merge (squash) June 27, 2025 18:05
@pickypg pickypg removed the conflicts There is a conflict in the backported pull request label Jun 27, 2025
@pickypg pickypg merged commit 5d077d9 into 8.19 Jun 27, 2025
200 checks passed
@pickypg pickypg deleted the mergify/bp/8.19/pr-45076 branch June 27, 2025 20:49
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