-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Component(s)
pkg/ottl
What happened?
Description
The profiles signal uses indices + lookup table instead of an array or map.
For example, pprofile.Profile contains a lookup table of attributes (AttributeTable), which is referenced by an array of indices (AttributeIndices).
During the work on the transformprocessor ([draft PR(https://github.com/https://github.com//pull/39036)), it turned out that a typical accessor/getter for attributes would return a pcommon.Map.
Problem
The Split() function doesn't call the target's setter function, so the result is effectively discarded in case of profile attributes.
It means that
set(attributes["test"], Split(attributes["flags"], "|"))
works for logs and metrics, but not for profiles.
Related: #39100
Steps to Reproduce
- Check out [processor/transform] Add support for profiles signal #39036
- uncomment the
Splittests inprocessor/transformprocessor/internal/profiles/processor_test.goat around L305ff - cd into
processor/transformprocessor/internal/profiles/and rungo test ./...
Expected Result
Updated attributes, tests succeed.
Actual Result
Attributes stay unchanged, tests fail.