Skip to content

Conversation

@RealAnna
Copy link
Contributor

Description

Supports non Map elements

Link to tracking issue

Fixes #43099

Testing

added a few corresponding table tests

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 14, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Oct 14, 2025
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@RealAnna RealAnna marked this pull request as draft October 14, 2025 08:28
@RealAnna RealAnna force-pushed the feat/nonmaps-elements-to-slicetomap branch from bc159a3 to 5dd8558 Compare October 14, 2025 08:34
@RealAnna RealAnna marked this pull request as ready for review October 14, 2025 08:34
@RealAnna RealAnna force-pushed the feat/nonmaps-elements-to-slicetomap branch from 5dd8558 to 1261caf Compare October 14, 2025 08:42
@odubajDT
Copy link
Contributor

@edmocosta could you please allow the workflow on this PR? Thank you!

Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RealAnna! Looks good so far.

@RealAnna RealAnna marked this pull request as draft October 15, 2025 09:50
RealAnna and others added 6 commits October 16, 2025 11:40
@RealAnna RealAnna force-pushed the feat/nonmaps-elements-to-slicetomap branch from 0f75296 to 1fb115b Compare October 16, 2025 09:40
@RealAnna RealAnna marked this pull request as ready for review October 17, 2025 07:59
Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, thanks for implementing it @RealAnna! I've left a few suggestions for your consideration.

elem := v.At(i)

// If key_path is not set, key is the index
key := strconv.Itoa(i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's only execute strconv.Itoa(i) if necessary and save some cycles on critical/busy paths, we can move this assignment down to the if useKeyPath condition.

}
extractedValue, err := extractValue(e, valuePath.Get())

err := putValue(value, m, key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The putValue function is probably not needed, we can replace it by:

value.CopyTo(m.PutEmpty(key))

RealAnna and others added 2 commits October 21, 2025 07:44
Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors pkg/ottl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pkg/ottl] Add support to convert non-map elements to SliceToMap

7 participants