Skip to content

[Observability] Fix KQL autocomplete in custom threshold rule creation#249894

Closed
cesco-f wants to merge 5 commits into
elastic:mainfrom
cesco-f:fix-rule-form
Closed

[Observability] Fix KQL autocomplete in custom threshold rule creation#249894
cesco-f wants to merge 5 commits into
elastic:mainfrom
cesco-f:fix-rule-form

Conversation

@cesco-f
Copy link
Copy Markdown
Contributor

@cesco-f cesco-f commented Jan 21, 2026

It closes #249869

Related to: #246674

Summary

Fixes KQL autocomplete in custom threshold rule creation by properly including the kql plugin in the service dependency chain.

Problem

When typing in the KQL filter field within the custom threshold rule form, users would see the error:

TypeError: Cannot read properties of undefined (reading 'autocomplete')

This occurred because the kql service was not properly injected into the Kibana context when rendering rule forms.

Root Cause

The issue had two parts:

  1. Observability plugin: kql was declared in requiredBundles instead of requiredPlugins in kibana.jsonc. The requiredBundles only bundles code together for tree-shaking but does NOT inject plugin services at runtime.

  2. Triggers-actions-ui plugin: Missing kql in the plugin dependencies and not passing it through the service chain to the rule form components.

E2E test:

  • Added new Scout test to verify KQL autocomplete works in custom threshold rule creation

Before:

Screen.Recording.2026-01-21.at.15.59.54.mov

After:

Screen.Recording.2026-01-21.at.16.01.26.mov

@cesco-f cesco-f requested review from a team as code owners January 21, 2026 15:05
@cesco-f cesco-f added release_note:fix backport:skip This PR does not require backporting labels Jan 21, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

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

@miguelmartin-elastic miguelmartin-elastic left a comment

Choose a reason for hiding this comment

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

lgtm, also tested it locally 🚀

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

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

[❌] x-pack/solutions/observability/plugins/observability/test/scout/ui/parallel.playwright.config.ts: 0/15 tests passed.

see run history

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #27 / Agent Builder tools MCP tools creating MCP tools should create an MCP tool by selecting connector and tool

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/response-ops-rule-form 192 193 +1
triggersActionsUi 507 508 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 2.9MB 2.9MB +14.0B
datasetQuality 592.0KB 592.0KB +14.0B
discover 1.4MB 1.4MB +14.0B
infra 1.2MB 1.2MB +14.0B
ml 5.6MB 5.6MB +14.0B
monitoring 633.7KB 633.7KB +14.0B
observability 1.8MB 1.8MB +14.0B
slo 1.1MB 1.1MB +14.0B
synthetics 1.0MB 1.0MB +14.0B
transform 624.8KB 624.8KB +14.0B
triggersActionsUi 1.7MB 1.7MB +14.0B
uptime 490.1KB 490.1KB +14.0B
total +168.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 108.3KB 108.3KB +30.0B
Unknown metric groups

API count

id before after diff
@kbn/response-ops-rule-form 193 194 +1
triggersActionsUi 511 512 +1
total +2

History

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

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

[❌] x-pack/solutions/observability/plugins/observability/test/scout/ui/parallel.playwright.config.ts: 0/15 tests passed.

see run history

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Jan 22, 2026

Closing in favor of #250044

@cesco-f cesco-f closed this Jan 22, 2026
@cesco-f cesco-f deleted the fix-rule-form branch January 23, 2026 15:12
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 release_note:fix Team:obs-ux-management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Alerting][Custom Threshold Rule] KQL Filter suggestions are not working

4 participants