-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Improve error when "null" is used instead of "nil" in OTTL: invalid path expression [{null []}] #29871
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. |
I agree that error isn't the best, I would be okay with catching null-variations and printing a message that nudges users in the right direction. At a minimum we should be printing a clearer error message for invalid paths to help explain where the user should look to fix the error. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
It would be a weird case, but technically a context someone creates could use We can improve the error message tho - I've opened a PR. |
In my opinion, the language should own concepts like null values. Having a keyword called
All that said, I think even just improving the error message is a win here. |
I agree that |
I agree that we should keep OTTL's keywords to a minimum (I would count even catching I think the best argument I could give is that if we add it before beta, it won't be a breaking change to later remove the excluded synonyms if someone says they want |
**Description:** Improve OTTL context error messages when an unknown path is used. The new error message will look like: ``` Error: invalid configuration: processors::transform: unable to parse OTTL statement "set(attributes[\"test\"], trace_id.hex)": error while parsing arguments for call to "set": invalid argument at position 1: trace_id.hex is not a valid path for the Span context - review https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/contexts/ottlspan to see all valid paths ``` **Link to tracking Issue:** <Issue number if applicable> Related to #29871 Closes #29922 **Testing:** <Describe what testing was performed and which tests were added.> Unit tests --------- Co-authored-by: Evan Bradley <[email protected]>
**Description:** Improve OTTL context error messages when an unknown path is used. The new error message will look like: ``` Error: invalid configuration: processors::transform: unable to parse OTTL statement "set(attributes[\"test\"], trace_id.hex)": error while parsing arguments for call to "set": invalid argument at position 1: trace_id.hex is not a valid path for the Span context - review https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/contexts/ottlspan to see all valid paths ``` **Link to tracking Issue:** <Issue number if applicable> Related to open-telemetry#29871 Closes open-telemetry#29922 **Testing:** <Describe what testing was performed and which tests were added.> Unit tests --------- Co-authored-by: Evan Bradley <[email protected]>
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Uh oh!
There was an error while loading. Please reload this page.
Component(s)
pkg/ottl
Describe the issue you're reporting
When an OTTL expression uses the term
null
instead of the intendednil
, the resulting error is not especially helpful, e.g.:The user should've written
!= nil
but the error could definitely help the user out.Same would make sense to do for
NULL
,NUL
andnul
.The text was updated successfully, but these errors were encountered: