Repository navigation
Apply saved-search filters to alert sample queries #3106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kodiakhq
merged 9 commits into
ClickHouse:main
from
Tyagiquamar:agent/fix-alert-sample-filters-3059
Sep 14, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0d0f6fb
Apply saved-search filters to alert sample queries
Tyagiquamar 3b15bea
fix(alerts): reuse search config for sample queries
Tyagiquamar b11786b
fix(alerts): fix lint errors and typing in alert template test
Tyagiquamar 402cd5f
feat: add an LLM dashboard user filter and make presence filters inde…
wrn14897 370b05d
fix: keep LLM dashboard scope filters clearable when their options fa…
wrn14897 3e929f0
chore(deps): bump next from 16.2.11 to 16.3.4 (#3108)
teeohhem 05bbb07
Merge remote-tracking branch 'origin/main' into agent/fix-alert-sampl…
pulpdrew cc397b5
Merge remote-tracking branch 'origin/main' into agent/fix-alert-sampl…
pulpdrew d4ba2d8
Merge branch 'main' into agent/fix-alert-sample-filters-3059
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@hyperdx/api': patch | ||
| --- | ||
|
|
||
| Apply saved-search pinned filters to alert notification sample queries so sample | ||
| log lines come from the same row set the alert counted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 minor — New test mocks the ClickHouse client, so it only pins SQL text — it never checks the filtered sample query runs or actually narrows the rows
The mock at line 726 swallows the query and returns a fixed
sampleLogsCsvregardless of what SQL was generated, so the only thing asserted is that the literalServiceName = 'checkout'appears somewhere in the string. BecausefetchSampleLinescatches every failure and returns''(template.ts:583-593), a sample query that the newfilters/tableFilterExpressionpath renders into invalid SQL degrades silently to an empty fenced block — and nothing catches it, since the real-ClickHouse saved-search cases incheckAlerts.int.test.tsassert the notification body asexpect.any(Object)(lines 2459 and 2472). Extend the existing saved-search-with-filter case that already runs against ClickHouse (checkAlerts.int.test.ts:2616-2687, whose saved search carriesfilters: [{ type: 'sql', condition: "service-nameIN ('svc-a')" }]over one matching and one non-matching row) to assert the rendered Slack body's fenced block containsmatches the saved filterand notexcluded by the saved filter— that pins execution and narrowing, which is the actual risk of this change.