Skip to content

Conversation

@kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Oct 24, 2025

Description

This commit added an "action" option to Logs, Metrics, Traces and Profiles to specify whether the given conditions are identifying what is kept or dropped.

  • "drop" (default): signals matching any condition are dropped.
  • "keep": signals matching any condition are kept, all others are dropped.

Example config

processors:
  filter:
    error_mode: propagate
    logs:
      action: "drop"
      log_record:
        - 'attributes["some"] == "values"'

If action is not specified, drop will be used.

Link to tracking issue

Fixes #42321

Testing

Added unit tests for the modified methods and functions

Documentation

Added docs for "action" to README.md

Action determines the behavior when Conditions match.
- "drop" (default): logs matching any condition are dropped.
- "keep": logs matching any condition are kept, all others are dropped.

Example config
```
  filter:
    error_mode: propagate
    logs:
      action: "drop"
      log_record:
        - 'attributes["some"] == "values"'
```
@kaisecheng kaisecheng marked this pull request as ready for review October 24, 2025 21:24
@github-actions github-actions bot added the processor/filter Filter processor label Oct 24, 2025
@github-actions github-actions bot requested a review from boostchicken October 24, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/filter Filter processor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[processor/filter]: Add Filter Action Identifier

2 participants