Skip to content

fix(query-engine): Fix OR operations being silently dropped - #21204

Merged
DylanGuedes merged 1 commit into
mainfrom
fix-or-operation
Mar 19, 2026
Merged

fix(query-engine): Fix OR operations being silently dropped #21204
DylanGuedes merged 1 commit into
mainfrom
fix-or-operation

Conversation

@DylanGuedes

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Our line filter conversion isn't looking at Or operations when materializing the AST, causing the second option of the OR filter to be silently dropped.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
@DylanGuedes
DylanGuedes requested a review from a team as a code owner March 19, 2026 17:41

@trevorwhitney trevorwhitney left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, nice catch, but does this mean we're also missing and operations?

func convertLineFilterExpr(expr *syntax.LineFilterExpr) Value {
current := convertLineFilter(expr.LineFilter)

if expr.Or != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean we're also missing and operations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replied to Trevor offline but for others following this PR: we somehow don't support and operations in line filters, just labels filters, I was somewhat surprised by that.

@DylanGuedes
DylanGuedes merged commit 20ea556 into main Mar 19, 2026
97 checks passed
@DylanGuedes
DylanGuedes deleted the fix-or-operation branch March 19, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants