Skip to content

Filter Processor should support inferred context statements #37904

Open
@jaronoff97

Description

@jaronoff97

Component(s)

pkg/ottl, processor/filter

Is your feature request related to a problem? Please describe.

With the introduction of passed in context to the filterottl package and inferred context for statements it would be great to bring these together for inferred context for conditions so that the filterprocessor (and the routing processor/connector eventually) could take advantage of the new flat-statement syntax.

Describe the solution you'd like

Ideally the configuration for the filterprocessor could be modified similar to the transform processor like so:

processors:
  filter/ottl:
    error_mode: ignore
    metrics:
      metric:
          - 'name == "my.metric" and resource.attributes["my_label"] == "abc123"'
          - 'type == METRIC_DATA_TYPE_HISTOGRAM'
      datapoint:
          - 'metric.type == METRIC_DATA_TYPE_SUMMARY'
          - 'resource.attributes["service.name"] == "my_service_name"'

to

processors:
  filter/ottl:
    error_mode: ignore
    metric_conditions:
          - 'metric.name == "my.metric" and resource.attributes["my_label"] == "abc123"'
          - 'metric.type == METRIC_DATA_TYPE_HISTOGRAM'
          - 'datapoint.attributes["hello"] == "world"'
          - 'resource.attributes["service.name"] == "my_service_name"'

This would allow a user to set both methods simultaneously keeping the functionality opt-in by default with a syntax matching that of the transform processor. If there are other recommendations for configuration, do let me know.

Describe alternatives you've considered

No response

Additional context

I'm planning on working on this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions