Skip to content

[Alerting] Allow KQL filtering for all types of aggregations when creating a Custom Threshold Rule#248845

Merged
miguelmartin-elastic merged 24 commits intoelastic:mainfrom
miguelmartin-elastic:231158-Add-kql-filtering-custom-rule
Feb 5, 2026
Merged

[Alerting] Allow KQL filtering for all types of aggregations when creating a Custom Threshold Rule#248845
miguelmartin-elastic merged 24 commits intoelastic:mainfrom
miguelmartin-elastic:231158-Add-kql-filtering-custom-rule

Conversation

@miguelmartin-elastic
Copy link
Copy Markdown
Contributor

@miguelmartin-elastic miguelmartin-elastic commented Jan 13, 2026

Release Notes

Support KQL filtering in all types of aggregations in Custom Threshold Rules

Summary

closes #231158

Before After
image image

Allow KQL filter to all types of aggregations when creating a Custom Threshold Rule

Alert details page

Filter info added to chart title and tooltip:
image

Testing

  1. Open the Custom Threshold Rule form
  2. Edit the aggregation A, verify that, when the Count aggregation type is selected, only one input is shown: KQL Filter A, and that it works correctly.
  3. Edit the aggregation A, verify that, when any other aggregation type is selected, two fields are shown: A) Field name and B) KQL Filter A. Verify that both work correctly.
  4. Create different aggregations using different aggregation types and combine them using the Equation field. Verify that it works correctly.

@github-actions github-actions Bot added the author:actionable-obs PRs authored by the actionable obs team label Jan 13, 2026
@miguelmartin-elastic
Copy link
Copy Markdown
Contributor Author

/ci

@miguelmartin-elastic miguelmartin-elastic added backport:skip This PR does not require backporting ci:cloud-deploy Create or update a Cloud deployment labels Jan 13, 2026
@miguelmartin-elastic miguelmartin-elastic changed the title [Alerting] Allow KQL filter to all types of aggregations when creating a Custom Threshold Rule [Alerting] Allow KQL filtering for all types of aggregations when creating a Custom Threshold Rule Jan 13, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Cloud deployment initiated, see credentials at: https://buildkite.com/elastic/kibana-deploy-cloud-from-pr/builds/648

@miguelmartin-elastic
Copy link
Copy Markdown
Contributor Author

/ci

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10469

[❌] x-pack/solutions/observability/test/observability_functional/with_rac_write.config.ts: 0/10 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10478

[❌] x-pack/solutions/observability/test/observability_functional/with_rac_write.config.ts: 0/10 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10481

[❌] x-pack/solutions/observability/test/observability_functional/with_rac_write.config.ts: 0/10 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10482

[❌] x-pack/solutions/observability/test/observability_functional/with_rac_write.config.ts: 0/10 tests passed.

see run history

@miguelmartin-elastic
Copy link
Copy Markdown
Contributor Author

/ci

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10483

[✅] x-pack/solutions/observability/test/observability_functional/with_rac_write.config.ts: 10/10 tests passed.

see run history

@miguelmartin-elastic miguelmartin-elastic marked this pull request as ready for review January 16, 2026 10:35
@miguelmartin-elastic miguelmartin-elastic requested a review from a team as a code owner January 16, 2026 10:35
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Copy Markdown
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

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

@miguelmartin-elastic when I try to save rule, I get the following error:

Screenshot 2026-01-20 at 5 01 40 PM

miguelmartin-elastic added a commit that referenced this pull request Jan 23, 2026
… and test snapshot (#249998)

## Summary

This PR is for an intermediate release for #248845 .

* Update the Custom Threshold Rule schema to accept an optional KQL
string filter as part of the `metrics` items : schema changed from
`never` to `optional string`

## Test
I tested it manually and verified that Custom Threshold Rules with the
new schema in place are executed without issues in current Kibana
version in `main`
@miguelmartin-elastic
Copy link
Copy Markdown
Contributor Author

miguelmartin-elastic commented Jan 29, 2026

hey @pmuellr , the intermediate release for this PR was already deployed to serverless in 6f03fc5236af. Are we good to go from your side?

@pmuellr
Copy link
Copy Markdown
Contributor

pmuellr commented Jan 29, 2026

the intermediate release for this PR was already deployed to serverless in 6f03fc5236af. Are we good to go from your side?

Looks like that was merged late-ish on Friday. We should double-check it made it into this week's build - I'll have to figure out how :-)

@pmuellr
Copy link
Copy Markdown
Contributor

pmuellr commented Jan 29, 2026

Ya, it did make it into this week's build (git commit is now written in all kinds of messages \o/ ), you should be good to go!

Copy link
Copy Markdown
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

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

Overall LGTM!

Could we include filter information on the chart title on alert details page?

Screenshot 2026-01-30 at 3 07 08 PM

@miguelmartin-elastic
Copy link
Copy Markdown
Contributor Author

filter info added to the title and tooltip @benakansara

@pmuellr pmuellr removed their request for review February 2, 2026 15:12
Copy link
Copy Markdown
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

ResponseOps changes to move to an intermediate release for this PR LGTM.

@miguelmartin-elastic miguelmartin-elastic added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Feb 3, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/actionable-obs-team (Team:actionable-obs)

Copy link
Copy Markdown
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

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

LGTM

@miguelmartin-elastic miguelmartin-elastic enabled auto-merge (squash) February 5, 2026 14:56
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Feb 5, 2026

⏳ Build in-progress

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #52 / Endpoint plugin @ess @serverless @skipInServerlessMKI Endpoint policy response api GET /api/endpoint/policy_response "before all" hook for "should return one policy response for an id"

History

@miguelmartin-elastic miguelmartin-elastic merged commit 05a94f6 into elastic:main Feb 5, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting ci:cloud-deploy Create or update a Cloud deployment ci:project-deploy-observability Create an Observability project release_note:enhancement Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:obs-ux-management v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Observability] [Custom threshold rule] Support additional filter for each aggregation type

6 participants