-
Notifications
You must be signed in to change notification settings - Fork 2.7k
OTTL context inference is incorrect when conditions used with statement #39455
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 @hisarbalik, that is indeed a bug we need to fix. Context-inferred advanced configurations are not taking into consideration the global conditions, and it might infer the wrong context depending on the statements & conditions used. metric_statements:
- context: metric
statements:
- set(resource.attributes["foo"], "bar")
conditions:
- IsMatch(metric.name, "^bar.*")
- IsMatch(metric.name, "^foo.*") |
I can take a look at this |
Hi @odubajDT, I'm working on this issue already. Thank you very much for volunteering :) |
…ntext inferrer conditions (#39465) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Added a new option `ottl.WithContextInferenceConditions` to the `ParserCollection.ParseStataments` so API users can provide extra context inferrer's conditions and have theirs hints considered by the default context inferrer. Follow up: #39463 (includes this PR changes) <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Relates to #39455 <!--Describe what testing was performed and which tests were added.--> #### Testing Unit tests
…ntext inferrer conditions (open-telemetry#39465) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Added a new option `ottl.WithContextInferenceConditions` to the `ParserCollection.ParseStataments` so API users can provide extra context inferrer's conditions and have theirs hints considered by the default context inferrer. Follow up: open-telemetry#39463 (includes this PR changes) <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Relates to open-telemetry#39455 <!--Describe what testing was performed and which tests were added.--> #### Testing Unit tests
…ntext inferrer conditions (open-telemetry#39465) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Added a new option `ottl.WithContextInferenceConditions` to the `ParserCollection.ParseStataments` so API users can provide extra context inferrer's conditions and have theirs hints considered by the default context inferrer. Follow up: open-telemetry#39463 (includes this PR changes) <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Relates to open-telemetry#39455 <!--Describe what testing was performed and which tests were added.--> #### Testing Unit tests
Component(s)
pkg/ottl
What happened?
Description
The OTTL context inference does not work when the statement is combined with conditions.
Steps to Reproduce
Run the following example in https://ottl.run :
The example above works when I add a
where
clause to the statement as a workaroundExpected Result
Should be no-op for the given example
Actual Result
Collector version
v0.124.0
Environment information
No response
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: