You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This PR is part of
open-telemetry#29017,
and adds the `ottl.Parser[K].AppendStatementPathsContext` function,
allowing components to rewrite statements appending missing `ottl.path`
context names.
For examples, the following context-less statement:
```
set(value, 1) where name == attributes["foo.name"]
```
Would be rewritten using the `span` context as:
```
set(span.value, 1) where span.name == span.attributes["foo.name"]
```
**Why do we need to rewrite statements?**
This utility will be used during the transition from structured OTTL
statements to flat statements.
Components such as the `transformprocessor` will leverage it to support
both configuration styles, without forcing
users to adapt/rewrite their existing config files.
Once the component turns on the `ottl.Parser[K]` path's context
validation, new configuration style usages will be validated, requiring
all paths to have a context prefix, and old configuration styles will
automatically rewrite the statements using this function.
For more details, please have a look at the complete
[draft](open-telemetry#35050)
implementation.
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
open-telemetry#29017
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests
<!--Describe the documentation added.-->
#### Documentation
No changes
<!--Please delete paragraphs that you did not use before submitting.-->
0 commit comments