-
Notifications
You must be signed in to change notification settings - Fork 2.7k
OTTL context inference order is incorrect for resources & scopes #39155
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
Comments
Pinging code owners: See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Thanks for reporting @axw, that's indeed a bug we need to fix. |
akshays-19
pushed a commit
to akshays-19/opentelemetry-collector-contrib
that referenced
this issue
Apr 23, 2025
… `resource` (open-telemetry#39307) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Changed the context inferrer so the `scope` context has priority over the `resource` context, fixing the error described on the linked issue. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#39155 <!--Please delete paragraphs that you did not use before submitting.-->
Fiery-Fenix
pushed a commit
to Fiery-Fenix/opentelemetry-collector-contrib
that referenced
this issue
Apr 24, 2025
… `resource` (open-telemetry#39307) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Changed the context inferrer so the `scope` context has priority over the `resource` context, fixing the error described on the linked issue. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#39155 <!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component(s)
pkg/ottl
What happened?
Description
The OTTL context inference order appears to be incorrect, which leads to the "resource" context being incorrectly picked instead of "scope".
I'm assuming this is due to "resource" coming before "scope" in
opentelemetry-collector-contrib/pkg/ottl/context_inferrer.go
Lines 17 to 26 in b8c2f0b
Steps to Reproduce
Run this in https://ottl.run:
Expected Result
Should be a no-op on the example input.
Actual Result
Results in an error:
Also if you look at the execution logs, you can see that "resource" was inferred where it should have been "scope":
Collector version
v0.123.0
Environment information
Environment
N/A
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: