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
Currently, it is not possible to pass a slice containing map literals to OTTL. This is because the mapGetter returns a pcommon.Map instead of a map[string]any:
Component(s)
pkg/ottl
What happened?
Description
Currently, it is not possible to pass a slice containing map literals to OTTL. This is because the mapGetter returns a
pcommon.Map
instead of amap[string]any
:opentelemetry-collector-contrib/pkg/ottl/expression.go
Lines 196 to 199 in 8034e0d
If a map literal then happens to be within a slice, eventually the
pcommon.Slice.FromRaw()
method will be invoked, which however only can handle raw types for its elements: https://github.com/open-telemetry/opentelemetry-collector/blob/6740a28a8003a534c20c2608d760edd015657622/pdata/pcommon/value.go#L134-L178Steps to Reproduce
Start the collector with the following config:
And send some test data to it, e.g. with
telemetrygen
:Expected Result
The
test
attribute should be added to the spanActual Result
The attribute is not added, due to the following error logged by the collector:
Collector version
v0.117.0
Environment information
Environment
OS: macOS
Compiler(if manually compiled): go 1.22
OpenTelemetry Collector configuration
Log output
Additional context
I already have a draft for a fix ready that I can provide
The text was updated successfully, but these errors were encountered: