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
[internal/filter] filtermetric to filterottl bridge (#23141)
**Description:**
This PR adds a bridge between `filtermetric.NewSkipExpr` and
`filterottl.NewBoolExprForMetric` behind a feature gate. With the
feature gate enabled, any component using `filtermetric.NewSkipExpr`
will start using OTTL behind the scenes.
In addition, the filterprocessor's implementation of `newSkipResExpr`,
which is a skip expression for resources, is bridged to
`filterottl.NewBoolExprForResource`. Since this implementation exists
only for filtering metrics, the same feature gate is used for both.
While investigating the existing `internal/filtermetric` uses with
filterprocessor and attributesprocessor I found that:
- The attributes processor does not support Expressions or Resource
Attributes. The readme claims that it does, but the implementation does
not support it (and there are no tests). This bridge DOES NOT rectify
that.
- The filterprocessor allows filtering by resource attributes,
expressions, and metric name. Unlike it's implementation for filtering
spans and logs, the filterprocessor handles filtering spans at the
Resource level loop. This is the most performant solution, and how OTTL
likes to think about the problem, but it results in a different pattern
than filtering spans and logs. This bridge DOES NOT attempt to move the
resource implementation into `internal/filtermetric`.
**Link to tracking Issue:**
Related to
#18643
Related to
#18642
Depends on:
- [x]
#23142
**Testing:**
Added tests comparing the output of the existing config and the bridge.
err: fmt.Errorf("expressions configuration cannot be converted to OTTL - see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#configuration for OTTL configuration"),
returnnil, fmt.Errorf("expressions configuration cannot be converted to OTTL - see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#configuration for OTTL configuration")
0 commit comments