Skip to content

Conversation

@rockdaboot
Copy link
Contributor

@rockdaboot rockdaboot commented Jun 25, 2025

Description

Introduce OTTL e2e tests based on profiles.
The tests uncovered an issue in accessAttributesKey(), which is fixed in this PR.

The e2e test have been requested here by @TylerHelmuth.

Link to tracking issue

Fixes #40738

THIS PR WILL ONLY WORK ON TOP OF #39416.

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

This gives me so much confidence, thank you for taking to time to make all these.

Copy link
Member

Choose a reason for hiding this comment

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

No changelog needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, but I think we should add a change log for the bug this PR is fixing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, but I think we should add a change log for the bug this PR is fixing.

}
}

func getAttributeValue[K ProfileContext](tCtx K, key string) pcommon.Value {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused with this fix, is overriding the existing keys at the profile dictionary expected here? considering it would indirectly change the value for all other references? Last time we discussed it duplicating keys was expected (#39681 (comment)), have it changed? If I'm not mistaken, that described scenario won't happen anymore with this fix, and the dictionary table item will be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot!
We definitely must not change any existing value in the dictionary attribute table here. Just pushed a fix for it and will later add tests that ensure that the dictionary attribute table isn't changed when adding or changing attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will also change the changelog to bug_fix and amend the description.

Copy link
Contributor Author

@rockdaboot rockdaboot Jul 9, 2025

Choose a reason for hiding this comment

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

  1. amended the changelog
  2. added a validation of dictionary tables to ensure that existing entries are not changed by operations. Does it make sense to do the validation in other test functions as well?

The validator could possibly be moved into pprofiletest, maybe in a follow-up PR.

Copy link
Contributor

@edmocosta edmocosta Jul 10, 2025

Choose a reason for hiding this comment

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

Does it make sense to do the validation in other test functions as well?

Converters should not change telemetry data, so it should be fine as it's (although we know they can sneakily do it by leveraging references).

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.

LGTM! Thank you very much for working on that!

@TylerHelmuth TylerHelmuth merged commit 951b2ff into open-telemetry:main Jul 10, 2025
177 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 10, 2025
Dylan-M pushed a commit to Dylan-M/opentelemetry-collector-contrib that referenced this pull request Aug 5, 2025
#### Description

Introduce OTTL e2e tests based on profiles.
The tests uncovered an issue in accessAttributesKey(), which is fixed in
this PR.

The e2e test have been requested
[here](open-telemetry#39416 (comment))
by @TylerHelmuth.

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

#### THIS PR WILL ONLY WORK ON TOP OF
open-telemetry#39416.

---------

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pkg/ottl] Add e2e test for profiles in ottlfuncs

4 participants