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
The backwards compatibility work is done when parsing the expression with a patcher struct that performs the string change:
type patcher struct{}
func (p *patcher) Visit(node *ast.Node) {
n, ok := (*node).(*ast.CallNode)
if !ok {
return
}
c, ok := (n.Callee).(*ast.IdentifierNode)
if !ok {
return
}
if c.Value == "env" {
c.Value = "os_env_func"
}
}
However, this patcher struct is not used consistently across all usages of the expr compilation work. The add operator specifically doesn't use it, and therefore fails to find the environment variable lookup function.
Component(s)
receiver/filelog
What happened?
See signalfx/splunk-otel-collector-chart#904 for original report.
The commit 44e1f67#diff-1d453bc7c5b0dd32eec0c83b9b06e6aeb291890d5cf7585d437cee1c209e40b4L123 changed the default value of the
env
function to beos_env_func
with the ability to patch back the calls toenv
to matchos_env_func
.The backwards compatibility work is done when parsing the expression with a patcher struct that performs the string change:
However, this patcher struct is not used consistently across all usages of the expr compilation work. The
add
operator specifically doesn't use it, and therefore fails to find the environment variable lookup function.#26374
Collector version
0.83.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: