Skip to content

feat(snuba): add OP_REGEXP to EAP comparison filters - #420

Merged
pbhandari merged 2 commits into
mainfrom
feat/regexp-search
Sep 8, 2026
Merged

feat(snuba): add OP_REGEXP to EAP comparison filters#420
pbhandari merged 2 commits into
mainfrom
feat/regexp-search

Conversation

@pbhandari

@pbhandari pbhandari commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds OP_REGEXP to snuba EAP filters, mirroring OP_EQUALS / OP_LIKE.

  • ComparisonFilter.Op.OP_REGEXP = 13 (TYPE_STRING/TYPE_ARRAY_STRING only, RE2)
  • AnyAttributeFilter.Op.OP_REGEXP = 7

Snuba PR: getsentry/snuba#8437

Test plan

  • Confirm buf lint / buf breaking pass
  • Snuba implements ClickHouse match for this op

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 8, 2026, 6:11 PM

@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

EAP-739

@pbhandari
pbhandari marked this pull request as ready for review September 8, 2026 17:31
@pbhandari
pbhandari requested a review from a team as a code owner September 8, 2026 17:31
@MeredithAnya

Copy link
Copy Markdown
Member

@pbhandari does 'string only' include TYPE_ARRAY_STRING ?

@pbhandari

Copy link
Copy Markdown
Contributor Author

@MeredithAnya Yes it does. Updated the PR description to clarify.

@pbhandari
pbhandari merged commit 09ae039 into main Sep 8, 2026
17 checks passed
pbhandari added a commit to getsentry/snuba that referenced this pull request Sep 10, 2026
## Problem

EAP RPC comparison filters have no regexp op. Logs search
([LOGS-958](https://linear.app/getsentry/issue/LOGS-958)) is blocked on
[EAP-739](https://linear.app/getsentry/issue/EAP-739/add-regexp-support-for-eap-rpc).

Depends on sentry-protos [PR
420](getsentry/sentry-protos#420) (`OP_REGEXP`
on ComparisonFilter / AnyAttributeFilter).

## Solution

Translate `OP_REGEXP` in the shared EAP filter translator to ClickHouse
`match()` (search-anywhere, RE2).

- Same type rules as LIKE (string and string-array keys)
- `ignore_case` → `match(lower(value), lower(pattern))`
- Empty pattern → 400
- ClickHouse `CANNOT_COMPILE_REGEXP` (36) remapped to RPC 400
- AnyAttribute op dispatch is a `match` including REGEXP

## Validation

`pytest tests/web/rpc/test_common.py::TestTraceItemFiltersRegexp` and
related LIKE/any-attribute tests.

## Linear


https://linear.app/getsentry/issue/EAP-739/add-regexp-support-for-eap-rpc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants