-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[pkg/ottl] Accessors for profile attributes #39681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[pkg/ottl] Accessors for profile attributes #39681
Conversation
3d6044b
to
ecc282f
Compare
ecc282f
to
6745566
Compare
} | ||
tCtx.GetProfile().AttributeIndices().FromRaw([]int32{}) | ||
for k, v := range m.All() { | ||
if err := PutAttribute(tCtx.GetProfile().AttributeTable(), tCtx.GetProfile(), k, v); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably missing something, but I wish we could make it more efficient. I understand why PutAttribute
/ AddAttribute
are that complex, but considering all the complexity around the profiles attributes read/write operations, and how slower it probably is compared to other pdata attributes (specially inside a loop), IMO, all the space complexity/reusability benefits we got from using this structure for profiles, maybe didn't worth it. It would be nice to have some pdata helpers/wrappers that makes it faster/easier to handle (just a thought, not a suggestion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically agree, but would wait until it turns out to be a bottleneck in the real world. Though, if we already know that there are use cases were hundreds or maybe thousands of attributes exist per message, then we should bring it up at the profiling SIG meeting.
Please mark it as ready for review when open-telemetry/opentelemetry-collector#12798 gets merged. Thanks. |
3657b38
to
df8e707
Compare
df8e707
to
3b1d852
Compare
53d4312
to
cbd181f
Compare
@edmocosta The pdata PutAttribute function now has been merged and adopted in this PR. I'd still wait for #39952 until marking this PR as ready to review. |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Access to these lookup tables isn't really useful, as they only provide a slice of values, and we can't check which one is being used by the current profile. Also, with open-telemetry/opentelemetry-collector#13075, the lookup tables are moving out of the profile and into a new dictionary object. So as a first step to the proto migration, this removes access to the lookup tables for a profile. The replacement for this is #39681, which will give acces to the profile attributes, as we do with other signals and abstract away the lookup tables. --------- Co-authored-by: Edmo Vamerlatti Costa <[email protected]>
Description
Adds support for
profile.attributes
to OTTL.This allows users to use profile.attributes without deeper knowledge of the protocol internals.
Currently, users have to deal with attribute_table and attribute_indices, which is error-prone and fragile when the experimental profiling signal changes internal representation.
This change depends on open-telemetry/opentelemetry-collector#12798 and thus includes that PR. It will be removed as soon as possible.
The profiles support for the transformprocessor currently relies/waits on this change.