Skip to content
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

[pkg/ottl] remove support from accessing top-level objects #36872

Merged

Conversation

TylerHelmuth
Copy link
Member

Description

Removes the path accessors for the shared contexts that allowed getting top level objects for:

  • resource
  • instrumentation_scope
  • metric
  • span

While these accessors existed the grammar didn't actually let you use them and their presence makes future work problematic. At this time we don't want to provide accessors to entire parent objects directly.

Link to tracking issue

Related to #36869

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.

Although it's not a breaking change, I'm wondering if we should have a change log for that, so users with this kind of no op statements would know why their configurations started to fail. If you think that's not needed, LGTM!

@evan-bradley
Copy link
Contributor

I think we need a changelog entry documenting this as a breaking change, but maybe I'm missing something. I was able to get the following statement to work:

set(cache["metric"], metric) where resource != nil

I can't come up with any real uses for this, but it does parse. Honestly, given that it's so unhelpful, I'm tempted to even say we could call this a bug fix.

@TylerHelmuth
Copy link
Member Author

I was able to get the following statement to work

It works when you're reaching up, but not when you're in the context itself.

So

context: datapoint
statements:
  - set(cache["metric"], metric)

works but

context: metric
statements:
  - set(cache["metric"], metric)

does not. I am ok calling this a bug_fix or a breaking change.

@evan-bradley evan-bradley removed the Skip Changelog PRs that do not require a CHANGELOG.md entry label Dec 17, 2024
@evan-bradley evan-bradley merged commit 829b010 into open-telemetry:main Dec 17, 2024
169 of 170 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 17, 2024
@TylerHelmuth TylerHelmuth deleted the ottl-remove-top-level-paths branch December 18, 2024 00:32
mterhar pushed a commit to mterhar/opentelemetry-collector-contrib that referenced this pull request Dec 19, 2024
AkhigbeEromo pushed a commit to sematext/opentelemetry-collector-contrib that referenced this pull request Jan 13, 2025
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.

4 participants