Skip to content

Conversation

rockdaboot
Copy link
Contributor

@rockdaboot rockdaboot commented Apr 28, 2025

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.

@github-actions github-actions bot requested a review from kentquirk April 28, 2025 08:20
@rockdaboot rockdaboot marked this pull request as draft April 28, 2025 08:20
@rockdaboot rockdaboot force-pushed the profiles-attribute-accessors branch from 3d6044b to ecc282f Compare April 28, 2025 08:23
@rockdaboot rockdaboot changed the title [chore] [pkg/ottl] Accessors for profile attributes [pkg/ottl] Accessors for profile attributes Apr 28, 2025
@rockdaboot rockdaboot force-pushed the profiles-attribute-accessors branch from ecc282f to 6745566 Compare April 29, 2025 07:32
@rockdaboot rockdaboot marked this pull request as ready for review April 29, 2025 07:33
@edmocosta edmocosta marked this pull request as draft May 5, 2025 15:28
@edmocosta
Copy link
Contributor

edmocosta commented May 5, 2025

Please mark it as ready for review when open-telemetry/opentelemetry-collector#12798 gets merged. Thanks.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

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 to me, thanks for working on that and I'm sorry for the reviewing delay.

Regarding the profile dictionary, whenever I set an attributes it creates another entry on the attributes tables and updates the profile's attributes indices, which I guess is expected as we might have the same key with different values used by different profiles. My only concern is how the transform processor, for example, will impact the size of that table, considering that it happens even when I set the same profile's attribute key. For example, the following statements would generate two profile attributes table entries:

- set(attributes["newKey"], 1)
- set(attributes["newKey"], 2)

I guess it's okay, but I'm wondering if future lower contexts, that will run it in a loop, could become an issue, as this table would grow very quickly depending on the users statements. Just a thought, I understand you cannot tackle it on this PR, but just wanted to double check this behavior.

@rockdaboot
Copy link
Contributor Author

rockdaboot commented Jun 18, 2025

It looks good to me, thanks for working on that and I'm sorry for the reviewing delay.

Regarding the profile dictionary, whenever I set an attributes it created another entry on the attributes tables and updates the profile's attributes indices, which I guess is expected as we might have the same key with different values used by different profiles. My only concern is how the transform processor, for example, will impact the size of that table, considering that it happens even when I set the same profile's attribute key. For example, the following statements would generate two profile attributes table entries:

- set(attributes["newKey"], 1)
- set(attributes["newKey"], 2)

I guess it's okay, but I'm wondering if future lower contexts, that will run it in a loop, could become an issue, as this table would grow very quickly depending on the users statements. Just a thought, I understand you cannot tackle it on this PR, but just wanted to double check this behavior.

Yes, that is expected atm. The table is a set of (unique) k/v pairs.
To automatically clean up unused entries, we would need something like a reference counter (and then re-use table entries with no reference).
Or as an expensive alternative, walk through all attribute index arrays to re-create the table.

But nothing we can tackle in this PR.

@evan-bradley evan-bradley merged commit 66bce50 into open-telemetry:main Jun 23, 2025
177 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 23, 2025
dd-jasminesun pushed a commit to DataDog/opentelemetry-collector-contrib that referenced this pull request Jun 23, 2025
<!--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
open-telemetry#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]>
dd-jasminesun pushed a commit to DataDog/opentelemetry-collector-contrib that referenced this pull request Jun 23, 2025
…yName()` internal functions (open-telemetry#39952)

#### Description
These functions have been requested
[here](open-telemetry#39681 (comment))
and
[here](open-telemetry#39681 (comment))
as prerequisite for OTTL attributes accessors for the profiles signal.

Also adds tests for `GetMap()`, that were missing.

#### Testing
Unit tests

---------

Co-authored-by: Edmo Vamerlatti Costa <[email protected]>
mx-psi pushed a commit that referenced this pull request Jul 14, 2025
#### Description
PR for profiles support in the transform processor.
It's a split-out from #39036 and contains only basic functionality, that
makes this PR independent from #39681, #39416 and
open-telemetry/opentelemetry-collector#12798.
For this, several tests were commented out.

The reason for this PR is the hope to get it merged so that users and
developers can start experimenting with profiles functionality in the
transformprocessor.

Attributes can't currently can't be used with profiles (due to the above
mentioned unmerged PRs).

#### Link to tracking issue
Fixes #39009

---------

Co-authored-by: Edmo Vamerlatti Costa <[email protected]>
Co-authored-by: Tyler Helmuth <[email protected]>
Dylan-M pushed a commit to Dylan-M/opentelemetry-collector-contrib that referenced this pull request Aug 5, 2025
Dylan-M pushed a commit to Dylan-M/opentelemetry-collector-contrib that referenced this pull request Aug 5, 2025
#### Description
PR for profiles support in the transform processor.
It's a split-out from open-telemetry#39036 and contains only basic functionality, that
makes this PR independent from open-telemetry#39681, open-telemetry#39416 and
open-telemetry/opentelemetry-collector#12798.
For this, several tests were commented out.

The reason for this PR is the hope to get it merged so that users and
developers can start experimenting with profiles functionality in the
transformprocessor.

Attributes can't currently can't be used with profiles (due to the above
mentioned unmerged PRs).

#### Link to tracking issue
Fixes open-telemetry#39009

---------

Co-authored-by: Edmo Vamerlatti Costa <[email protected]>
Co-authored-by: Tyler Helmuth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants