Skip to content

[Response Ops] [Dashboard] Create a rule from a dashboard ES|QL visualization#217719

Merged
Zacqary merged 114 commits intoelastic:mainfrom
Zacqary:208854-rule-from-dash-vis
May 9, 2025
Merged

[Response Ops] [Dashboard] Create a rule from a dashboard ES|QL visualization#217719
Zacqary merged 114 commits intoelastic:mainfrom
Zacqary:208854-rule-from-dash-vis

Conversation

@Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Apr 9, 2025

Summary

Closes #208854

This adds a tooltip action and a context menu action to the ES|QL panel type allowing the user to create an Elasticsearch Query rule from the visualization on the panel. Lens panels are currently not supported.

Tooltip action

Screenshot 2025-04-09 at 11 06 25 AM

Prefill the time field from the chart, and the alert window from the dashboard's current displayed time range:
Screenshot 2025-04-09 at 11 06 46 AM

Add an extra clause to the end of the visualization's ES|QL query to set an alert threshold based on the data point that the user clicked on:
Screenshot 2025-04-09 at 11 06 55 AM

Context menu action

Screenshot 2025-04-09 at 11 07 41 AM

Creating a rule from the context menu instead of from a tooltip doesn't give us a pre-filled threshold value, so we ask the user to specify it:
Screenshot 2025-04-09 at 11 07 48 AM

Supported cases

Breakdowns and split values:

Screenshot 2025-04-09 at 11 14 47 AM Screenshot 2025-04-09 at 11 14 56 AM

Escaping column names

Screenshot 2025-04-09 at 11 18 08 AM Screenshot 2025-04-09 at 11 18 42 AM

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

Release note

Adds the Create alert rule action to ES|QL dashboard panels, usable from the panel context menu or by right-clicking a data point on the visualization. This allows you to generate an alert when the data on the chart crosses a certain threshold.

@Zacqary Zacqary added Feature:Dashboard Dashboard related features Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// release_note:feature Makes this part of the condensed release notes Feature:Alerting/RulesManagement Issues related to the Rules Management UX backport:version Backport to applied version labels v9.1.0 labels Apr 9, 2025
export const alertRuleTrigger: Trigger = {
id: ALERT_RULE_TRIGGER,
title: i18n.translate('uiActions.triggers.dashboard.alertRule.title', {
defaultMessage: 'Add alert rule',

Choose a reason for hiding this comment

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

Could you please change text to Create alert rule

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, updated in 3f61682

Copy link

@joana-cps joana-cps left a comment

Choose a reason for hiding this comment

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

Design changes LGTM, thanks for implementing them

Left just 2 small nit comments.

FYI We agreed that some of the proposed changes in #217719 (comment) will be addressed separately as part of #196235 since they affect all the Rule types:

  • Experiment using compressed fields in all Rule form flyouts
  • Avoid using a panel inside flyout
  • Improve query selection in ES query rule (#209002)
  • Improve responsive (flyout) version of the rule form
  • Rule type name consistency
Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

ResponseOps code LGTM! I found it hard to follow the code inside AlertRuleFromVisAction. Could you please split the code execute into smaller functions with clear boundaries and responsibilities? It will help a lot with bugs and enhancement requests in he future and make it easier to reason about what the code does.

@Zacqary Zacqary enabled auto-merge (squash) May 8, 2025 19:50
@Zacqary Zacqary merged commit 7e5c774 into elastic:main May 9, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/14935886414

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / Templates renders empty templates correctly

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 572 573 +1
apm 1883 1884 +1
cloudSecurityPosture 675 676 +1
discover 1241 1242 +1
esqlDataGrid 413 414 +1
eventAnnotationListing 587 588 +1
expressionXY 254 262 +8
lens 1371 1599 +228
observability 1289 1290 +1
securitySolution 7337 7338 +1
slo 1110 1111 +1
synthetics 1195 1196 +1
triggersActionsUi 732 809 +77
uiActions 27 28 +1
visualizations 566 574 +8
total +332

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/alerts-ui-shared 288 293 +5
expressions 1795 1796 +1
lens 556 559 +3
visualizations 835 836 +1
total +10

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.5MB 2.5MB +126.0B
discover 1006.6KB 1006.9KB +365.0B
esql 245.8KB 246.0KB +220.0B
expressionXY 98.0KB 99.7KB +1.7KB
infra 1.1MB 1.1MB +126.0B
lens 1.4MB 1.6MB +144.8KB
ml 5.3MB 5.3MB +126.0B
monitoring 624.5KB 624.6KB +126.0B
observability 1.3MB 1.3MB +126.0B
securitySolution 9.1MB 9.1MB +239.0B
slo 912.6KB 912.9KB +365.0B
stackAlerts 65.3KB 65.3KB +23.0B
synthetics 967.2KB 967.3KB +126.0B
transform 617.7KB 617.9KB +126.0B
triggersActionsUi 1.4MB 1.4MB +126.0B
uptime 486.1KB 486.2KB +126.0B
visualizations 335.5KB 335.5KB +2.0B
total +148.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/response-ops-rule-params 0 1 +1
visualizations 22 23 +1
total +2

Page load bundle

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

id before after diff
data 402.2KB 402.3KB +28.0B
expressions 93.1KB 93.3KB +227.0B
expressionXY 39.3KB 40.1KB +745.0B
lens 58.9KB 59.4KB +459.0B
synthetics 27.5KB 27.8KB +239.0B
triggersActionsUi 102.0KB 108.9KB +6.9KB
uiActions 21.6KB 21.9KB +308.0B
visualizations 35.3KB 36.2KB +897.0B
total +9.7KB
Unknown metric groups

API count

id before after diff
@kbn/alerts-ui-shared 305 310 +5
@kbn/esql-editor 34 35 +1
esql 36 37 +1
expressions 2267 2269 +2
lens 655 658 +3
visualizations 866 867 +1
total +13

async chunk count

id before after diff
lens 18 21 +3

miscellaneous assets size

id before after diff
lens 931.7KB 1.3MB ⚠️ +379.0KB

History

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 217719

Questions ?

Please refer to the Backport tool documentation

@Zacqary
Copy link
Contributor Author

Zacqary commented May 9, 2025

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

Zacqary added a commit to Zacqary/kibana that referenced this pull request May 9, 2025
…lization (elastic#217719)

## Summary

Closes elastic#208854

This adds a tooltip action and a context menu action to the **ES|QL**
panel type allowing the user to create an Elasticsearch Query rule from
the visualization on the panel. Lens panels are currently not supported.

### Tooltip action
<img width="1081" alt="Screenshot 2025-04-09 at 11 06 25 AM"
src="https://github.com/user-attachments/assets/3315cd9f-6dda-44b0-8e7c-eb295c08b89f"
/>

Prefill the time field from the chart, and the alert window from the
dashboard's current displayed time range:
<img width="588" alt="Screenshot 2025-04-09 at 11 06 46 AM"
src="https://github.com/user-attachments/assets/c06a99ab-ce67-4c88-b4ff-dd6edd9e864a"
/>

Add an extra clause to the end of the visualization's ES|QL query to set
an alert threshold based on the data point that the user clicked on:
<img width="562" alt="Screenshot 2025-04-09 at 11 06 55 AM"
src="https://github.com/user-attachments/assets/27a6552b-b5be-4cb7-80aa-74c683b93ae4"
/>

### Context menu action
<img width="1107" alt="Screenshot 2025-04-09 at 11 07 41 AM"
src="https://github.com/user-attachments/assets/fe6d7f76-68e6-4345-b2a8-e47d1363d7d8"
/>

Creating a rule from the context menu instead of from a tooltip doesn't
give us a pre-filled threshold value, so we ask the user to specify it:
<img width="563" alt="Screenshot 2025-04-09 at 11 07 48 AM"
src="https://github.com/user-attachments/assets/83a7f51b-bb87-4637-b602-b169b3f0a375"
/>

### Supported cases
#### Breakdowns and split values:
<img width="1077" alt="Screenshot 2025-04-09 at 11 14 47 AM"
src="https://github.com/user-attachments/assets/d691d247-27af-45d1-82ac-b50aaa20e9f9"
/>
<img width="556" alt="Screenshot 2025-04-09 at 11 14 56 AM"
src="https://github.com/user-attachments/assets/3b97f08d-00b5-464d-8700-59d6d4a4d473"
/>

#### Escaping column names
<img width="668" alt="Screenshot 2025-04-09 at 11 18 08 AM"
src="https://github.com/user-attachments/assets/ad98cb2a-d167-4175-acd5-bc81822a2d1c"
/>
<img width="574" alt="Screenshot 2025-04-09 at 11 18 42 AM"
src="https://github.com/user-attachments/assets/d6805e93-2592-4a66-b59e-7ceffca579c7"
/>

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note
Adds the Create alert rule action to ES|QL dashboard panels, usable from
the panel context menu or by right-clicking a data point on the
visualization. This allows you to generate an alert when the data on the
chart crosses a certain threshold.

---------

Co-authored-by: mbondyra <marta.bondyra@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Co-authored-by: dej611 <dej611@gmail.com>
(cherry picked from commit 7e5c774)

# Conflicts:
#	src/platform/plugins/shared/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx
#	src/platform/plugins/shared/chart_expressions/expression_xy/tsconfig.json
#	x-pack/platform/plugins/shared/lens/kibana.jsonc
#	x-pack/platform/plugins/shared/lens/public/react_embeddable/initializers/initialize_edit.tsx
Zacqary added a commit that referenced this pull request May 11, 2025
…L visualization (#217719) (#220719)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Response Ops] [Dashboard] Create a rule from a dashboard ES|QL
visualization (#217719)](#217719)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Zacqary Adam
Xeper","email":"Zacqary@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-09T19:04:00Z","message":"[Response
Ops] [Dashboard] Create a rule from a dashboard ES|QL visualization
(#217719)\n\n## Summary\n\nCloses #208854 \n\nThis adds a tooltip action
and a context menu action to the **ES|QL**\npanel type allowing the user
to create an Elasticsearch Query rule from\nthe visualization on the
panel. Lens panels are currently not supported.\n\n### Tooltip
action\n<img width=\"1081\" alt=\"Screenshot 2025-04-09 at 11 06
25 AM\"\nsrc=\"https://github.com/user-attachments/assets/3315cd9f-6dda-44b0-8e7c-eb295c08b89f\"\n/>\n\nPrefill
the time field from the chart, and the alert window from
the\ndashboard's current displayed time range:\n<img width=\"588\"
alt=\"Screenshot 2025-04-09 at 11 06
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/c06a99ab-ce67-4c88-b4ff-dd6edd9e864a\"\n/>\n\nAdd
an extra clause to the end of the visualization's ES|QL query to set\nan
alert threshold based on the data point that the user clicked on:\n<img
width=\"562\" alt=\"Screenshot 2025-04-09 at 11 06
55 AM\"\nsrc=\"https://github.com/user-attachments/assets/27a6552b-b5be-4cb7-80aa-74c683b93ae4\"\n/>\n\n\n\n###
Context menu action\n<img width=\"1107\" alt=\"Screenshot 2025-04-09 at
11 07
41 AM\"\nsrc=\"https://github.com/user-attachments/assets/fe6d7f76-68e6-4345-b2a8-e47d1363d7d8\"\n/>\n\nCreating
a rule from the context menu instead of from a tooltip doesn't\ngive us
a pre-filled threshold value, so we ask the user to specify it:\n<img
width=\"563\" alt=\"Screenshot 2025-04-09 at 11 07
48 AM\"\nsrc=\"https://github.com/user-attachments/assets/83a7f51b-bb87-4637-b602-b169b3f0a375\"\n/>\n\n###
Supported cases\n#### Breakdowns and split values:\n<img width=\"1077\"
alt=\"Screenshot 2025-04-09 at 11 14
47 AM\"\nsrc=\"https://github.com/user-attachments/assets/d691d247-27af-45d1-82ac-b50aaa20e9f9\"\n/>\n<img
width=\"556\" alt=\"Screenshot 2025-04-09 at 11 14
56 AM\"\nsrc=\"https://github.com/user-attachments/assets/3b97f08d-00b5-464d-8700-59d6d4a4d473\"\n/>\n\n####
Escaping column names\n<img width=\"668\" alt=\"Screenshot 2025-04-09 at
11 18
08 AM\"\nsrc=\"https://github.com/user-attachments/assets/ad98cb2a-d167-4175-acd5-bc81822a2d1c\"\n/>\n<img
width=\"574\" alt=\"Screenshot 2025-04-09 at 11 18
42 AM\"\nsrc=\"https://github.com/user-attachments/assets/d6805e93-2592-4a66-b59e-7ceffca579c7\"\n/>\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n##
Release note\nAdds the Create alert rule action to ES|QL dashboard
panels, usable from\nthe panel context menu or by right-clicking a data
point on the\nvisualization. This allows you to generate an alert when
the data on the\nchart crosses a certain
threshold.\n\n---------\n\nCo-authored-by: mbondyra
<marta.bondyra@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>\nCo-authored-by:
Marco Vettorello <vettorello.marco@gmail.com>\nCo-authored-by: Marco
Liberati <dej611@users.noreply.github.com>\nCo-authored-by: dej611
<dej611@gmail.com>","sha":"7e5c77474ab5f036ac93fcde90bd58ced2d94a51","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","Team:Presentation","Feature:ExpressionLanguage","loe:large","Team:Visualizations","impact:high","Team:ResponseOps","release_note:feature","Feature:Alerting/RulesManagement","ci:build-webpack-bundle-analyzer","Feature:ES|QL","backport:version","v9.1.0","v8.19.0"],"title":"[Response
Ops] [Dashboard] Create a rule from a dashboard ES|QL
visualization","number":217719,"url":"https://github.com/elastic/kibana/pull/217719","mergeCommit":{"message":"[Response
Ops] [Dashboard] Create a rule from a dashboard ES|QL visualization
(#217719)\n\n## Summary\n\nCloses #208854 \n\nThis adds a tooltip action
and a context menu action to the **ES|QL**\npanel type allowing the user
to create an Elasticsearch Query rule from\nthe visualization on the
panel. Lens panels are currently not supported.\n\n### Tooltip
action\n<img width=\"1081\" alt=\"Screenshot 2025-04-09 at 11 06
25 AM\"\nsrc=\"https://github.com/user-attachments/assets/3315cd9f-6dda-44b0-8e7c-eb295c08b89f\"\n/>\n\nPrefill
the time field from the chart, and the alert window from
the\ndashboard's current displayed time range:\n<img width=\"588\"
alt=\"Screenshot 2025-04-09 at 11 06
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/c06a99ab-ce67-4c88-b4ff-dd6edd9e864a\"\n/>\n\nAdd
an extra clause to the end of the visualization's ES|QL query to set\nan
alert threshold based on the data point that the user clicked on:\n<img
width=\"562\" alt=\"Screenshot 2025-04-09 at 11 06
55 AM\"\nsrc=\"https://github.com/user-attachments/assets/27a6552b-b5be-4cb7-80aa-74c683b93ae4\"\n/>\n\n\n\n###
Context menu action\n<img width=\"1107\" alt=\"Screenshot 2025-04-09 at
11 07
41 AM\"\nsrc=\"https://github.com/user-attachments/assets/fe6d7f76-68e6-4345-b2a8-e47d1363d7d8\"\n/>\n\nCreating
a rule from the context menu instead of from a tooltip doesn't\ngive us
a pre-filled threshold value, so we ask the user to specify it:\n<img
width=\"563\" alt=\"Screenshot 2025-04-09 at 11 07
48 AM\"\nsrc=\"https://github.com/user-attachments/assets/83a7f51b-bb87-4637-b602-b169b3f0a375\"\n/>\n\n###
Supported cases\n#### Breakdowns and split values:\n<img width=\"1077\"
alt=\"Screenshot 2025-04-09 at 11 14
47 AM\"\nsrc=\"https://github.com/user-attachments/assets/d691d247-27af-45d1-82ac-b50aaa20e9f9\"\n/>\n<img
width=\"556\" alt=\"Screenshot 2025-04-09 at 11 14
56 AM\"\nsrc=\"https://github.com/user-attachments/assets/3b97f08d-00b5-464d-8700-59d6d4a4d473\"\n/>\n\n####
Escaping column names\n<img width=\"668\" alt=\"Screenshot 2025-04-09 at
11 18
08 AM\"\nsrc=\"https://github.com/user-attachments/assets/ad98cb2a-d167-4175-acd5-bc81822a2d1c\"\n/>\n<img
width=\"574\" alt=\"Screenshot 2025-04-09 at 11 18
42 AM\"\nsrc=\"https://github.com/user-attachments/assets/d6805e93-2592-4a66-b59e-7ceffca579c7\"\n/>\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n##
Release note\nAdds the Create alert rule action to ES|QL dashboard
panels, usable from\nthe panel context menu or by right-clicking a data
point on the\nvisualization. This allows you to generate an alert when
the data on the\nchart crosses a certain
threshold.\n\n---------\n\nCo-authored-by: mbondyra
<marta.bondyra@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>\nCo-authored-by:
Marco Vettorello <vettorello.marco@gmail.com>\nCo-authored-by: Marco
Liberati <dej611@users.noreply.github.com>\nCo-authored-by: dej611
<dej611@gmail.com>","sha":"7e5c77474ab5f036ac93fcde90bd58ced2d94a51"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217719","number":217719,"mergeCommit":{"message":"[Response
Ops] [Dashboard] Create a rule from a dashboard ES|QL visualization
(#217719)\n\n## Summary\n\nCloses #208854 \n\nThis adds a tooltip action
and a context menu action to the **ES|QL**\npanel type allowing the user
to create an Elasticsearch Query rule from\nthe visualization on the
panel. Lens panels are currently not supported.\n\n### Tooltip
action\n<img width=\"1081\" alt=\"Screenshot 2025-04-09 at 11 06
25 AM\"\nsrc=\"https://github.com/user-attachments/assets/3315cd9f-6dda-44b0-8e7c-eb295c08b89f\"\n/>\n\nPrefill
the time field from the chart, and the alert window from
the\ndashboard's current displayed time range:\n<img width=\"588\"
alt=\"Screenshot 2025-04-09 at 11 06
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/c06a99ab-ce67-4c88-b4ff-dd6edd9e864a\"\n/>\n\nAdd
an extra clause to the end of the visualization's ES|QL query to set\nan
alert threshold based on the data point that the user clicked on:\n<img
width=\"562\" alt=\"Screenshot 2025-04-09 at 11 06
55 AM\"\nsrc=\"https://github.com/user-attachments/assets/27a6552b-b5be-4cb7-80aa-74c683b93ae4\"\n/>\n\n\n\n###
Context menu action\n<img width=\"1107\" alt=\"Screenshot 2025-04-09 at
11 07
41 AM\"\nsrc=\"https://github.com/user-attachments/assets/fe6d7f76-68e6-4345-b2a8-e47d1363d7d8\"\n/>\n\nCreating
a rule from the context menu instead of from a tooltip doesn't\ngive us
a pre-filled threshold value, so we ask the user to specify it:\n<img
width=\"563\" alt=\"Screenshot 2025-04-09 at 11 07
48 AM\"\nsrc=\"https://github.com/user-attachments/assets/83a7f51b-bb87-4637-b602-b169b3f0a375\"\n/>\n\n###
Supported cases\n#### Breakdowns and split values:\n<img width=\"1077\"
alt=\"Screenshot 2025-04-09 at 11 14
47 AM\"\nsrc=\"https://github.com/user-attachments/assets/d691d247-27af-45d1-82ac-b50aaa20e9f9\"\n/>\n<img
width=\"556\" alt=\"Screenshot 2025-04-09 at 11 14
56 AM\"\nsrc=\"https://github.com/user-attachments/assets/3b97f08d-00b5-464d-8700-59d6d4a4d473\"\n/>\n\n####
Escaping column names\n<img width=\"668\" alt=\"Screenshot 2025-04-09 at
11 18
08 AM\"\nsrc=\"https://github.com/user-attachments/assets/ad98cb2a-d167-4175-acd5-bc81822a2d1c\"\n/>\n<img
width=\"574\" alt=\"Screenshot 2025-04-09 at 11 18
42 AM\"\nsrc=\"https://github.com/user-attachments/assets/d6805e93-2592-4a66-b59e-7ceffca579c7\"\n/>\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n##
Release note\nAdds the Create alert rule action to ES|QL dashboard
panels, usable from\nthe panel context menu or by right-clicking a data
point on the\nvisualization. This allows you to generate an alert when
the data on the\nchart crosses a certain
threshold.\n\n---------\n\nCo-authored-by: mbondyra
<marta.bondyra@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>\nCo-authored-by:
Marco Vettorello <vettorello.marco@gmail.com>\nCo-authored-by: Marco
Liberati <dej611@users.noreply.github.com>\nCo-authored-by: dej611
<dej611@gmail.com>","sha":"7e5c77474ab5f036ac93fcde90bd58ced2d94a51"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
markov00 added a commit that referenced this pull request May 26, 2025
## Summary

fix #221241

## Bug and fix descriptions

The logic that applies a time filter by updating the time picker vs
adding it as a filter pill in the filter bar is described here:

https://github.com/elastic/kibana/blob/e877bafa3e4725d3e7cfd3b2ca0be4bc6d88a0b9/src/platform/plugins/shared/unified_search/public/actions/apply_filter_action/apply_filter_action.tsx#L107-L114

The `extractTimeFilter` function extracts the `timeRangeFilter` only if
the `timeFieldName === keys(filter.query.range)[0]` . The problem was
that the first key of `query.range` was different than the
`timeFieldName`. That `timeFieldName` in the ESQL world was wrongly
applied via the ` table.columns[xAxisColumnIndex].name` that doesn't
reflect the actual column name for ES|QL, in fact that name reflect the
visualization label name for the time dimension. In particular, before
the fix, that timeFieldName was set as the axis name (e.g.`@timestamp
every 5 minute` ) and cause the time range filter to fail to be
extracted from the filters list.

A combination of two PRs caused this to be now anymore the correct
behaviour:
- this PR #196049 introduced the
use of the `souceField` as field name for the creation of filter from a
range
- this PR #217719 instead
introduced the use of `sourceField` also for ESQL datasources. This
field points to the actual column name described in the ESQL query.

Both PR causes the `extractTimeFilter` to fail to extract the
timeFilter, pushing the filter up to the filter pills.

### Side notes

This could be probably fixed in other ways, like by avoiding using the
`sourceField` in ESQL, or by using only the column.name in the filter
creation, or by avoiding checking the `timeFieldName` against the
`query.range` key (not really sure why this is required). In general the
problem here is that there is a low confidence on what these
fields/params are supposed to be and which is supposted to be the
identifiers to use everywhere. For example the column ids reflects only
a link between the rows and the column descriptions, the name is the
associated label, but can we rely on that label for filtering? i believe
we need a stronger connection with the data and the actual original
source field or column identifier is a better choice.
I believe a valid subsequent task is
#189044
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 26, 2025
## Summary

fix elastic#221241

## Bug and fix descriptions

The logic that applies a time filter by updating the time picker vs
adding it as a filter pill in the filter bar is described here:

https://github.com/elastic/kibana/blob/e877bafa3e4725d3e7cfd3b2ca0be4bc6d88a0b9/src/platform/plugins/shared/unified_search/public/actions/apply_filter_action/apply_filter_action.tsx#L107-L114

The `extractTimeFilter` function extracts the `timeRangeFilter` only if
the `timeFieldName === keys(filter.query.range)[0]` . The problem was
that the first key of `query.range` was different than the
`timeFieldName`. That `timeFieldName` in the ESQL world was wrongly
applied via the ` table.columns[xAxisColumnIndex].name` that doesn't
reflect the actual column name for ES|QL, in fact that name reflect the
visualization label name for the time dimension. In particular, before
the fix, that timeFieldName was set as the axis name (e.g.`@timestamp
every 5 minute` ) and cause the time range filter to fail to be
extracted from the filters list.

A combination of two PRs caused this to be now anymore the correct
behaviour:
- this PR elastic#196049 introduced the
use of the `souceField` as field name for the creation of filter from a
range
- this PR elastic#217719 instead
introduced the use of `sourceField` also for ESQL datasources. This
field points to the actual column name described in the ESQL query.

Both PR causes the `extractTimeFilter` to fail to extract the
timeFilter, pushing the filter up to the filter pills.

### Side notes

This could be probably fixed in other ways, like by avoiding using the
`sourceField` in ESQL, or by using only the column.name in the filter
creation, or by avoiding checking the `timeFieldName` against the
`query.range` key (not really sure why this is required). In general the
problem here is that there is a low confidence on what these
fields/params are supposed to be and which is supposted to be the
identifiers to use everywhere. For example the column ids reflects only
a link between the rows and the column descriptions, the name is the
associated label, but can we rely on that label for filtering? i believe
we need a stronger connection with the data and the actual original
source field or column identifier is a better choice.
I believe a valid subsequent task is
elastic#189044

(cherry picked from commit eb4ba96)
kibanamachine added a commit that referenced this pull request May 26, 2025
…) (#221524)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ES|QL] Use correct timeFieldName for time brush filter
(#221322)](#221322)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marco
Vettorello","email":"marco.vettorello@elastic.co"},"sourceCommit":{"committedDate":"2025-05-26T14:41:06Z","message":"[ES|QL]
Use correct timeFieldName for time brush filter (#221322)\n\n##
Summary\n\nfix #221241\n\n## Bug and fix descriptions\n\nThe logic that
applies a time filter by updating the time picker vs\nadding it as a
filter pill in the filter bar is described
here:\n\nhttps://github.com/elastic/kibana/blob/e877bafa3e4725d3e7cfd3b2ca0be4bc6d88a0b9/src/platform/plugins/shared/unified_search/public/actions/apply_filter_action/apply_filter_action.tsx#L107-L114\n\nThe
`extractTimeFilter` function extracts the `timeRangeFilter` only if\nthe
`timeFieldName === keys(filter.query.range)[0]` . The problem was\nthat
the first key of `query.range` was different than the\n`timeFieldName`.
That `timeFieldName` in the ESQL world was wrongly\napplied via the `
table.columns[xAxisColumnIndex].name` that doesn't\nreflect the actual
column name for ES|QL, in fact that name reflect the\nvisualization
label name for the time dimension. In particular, before\nthe fix, that
timeFieldName was set as the axis name (e.g.`@timestamp\nevery 5 minute`
) and cause the time range filter to fail to be\nextracted from the
filters list.\n\nA combination of two PRs caused this to be now anymore
the correct\nbehaviour:\n- this PR
#196049 introduced the\nuse of the
`souceField` as field name for the creation of filter from a\nrange\n-
this PR #217719
instead\nintroduced the use of `sourceField` also for ESQL datasources.
This\nfield points to the actual column name described in the ESQL
query.\n\nBoth PR causes the `extractTimeFilter` to fail to extract
the\ntimeFilter, pushing the filter up to the filter pills.\n\n### Side
notes\n\nThis could be probably fixed in other ways, like by avoiding
using the\n`sourceField` in ESQL, or by using only the column.name in
the filter\ncreation, or by avoiding checking the `timeFieldName`
against the\n`query.range` key (not really sure why this is required).
In general the\nproblem here is that there is a low confidence on what
these\nfields/params are supposed to be and which is supposted to be
the\nidentifiers to use everywhere. For example the column ids reflects
only\na link between the rows and the column descriptions, the name is
the\nassociated label, but can we rely on that label for filtering? i
believe\nwe need a stronger connection with the data and the actual
original\nsource field or column identifier is a better choice.\nI
believe a valid subsequent task
is\nhttps://github.com//issues/189044","sha":"eb4ba962ec29256f086ade49d04150c3aec1789b","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Visualizations","release_note:skip","Feature:ES|QL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL]
Use correct timeFieldName for time brush
filter","number":221322,"url":"https://github.com/elastic/kibana/pull/221322","mergeCommit":{"message":"[ES|QL]
Use correct timeFieldName for time brush filter (#221322)\n\n##
Summary\n\nfix #221241\n\n## Bug and fix descriptions\n\nThe logic that
applies a time filter by updating the time picker vs\nadding it as a
filter pill in the filter bar is described
here:\n\nhttps://github.com/elastic/kibana/blob/e877bafa3e4725d3e7cfd3b2ca0be4bc6d88a0b9/src/platform/plugins/shared/unified_search/public/actions/apply_filter_action/apply_filter_action.tsx#L107-L114\n\nThe
`extractTimeFilter` function extracts the `timeRangeFilter` only if\nthe
`timeFieldName === keys(filter.query.range)[0]` . The problem was\nthat
the first key of `query.range` was different than the\n`timeFieldName`.
That `timeFieldName` in the ESQL world was wrongly\napplied via the `
table.columns[xAxisColumnIndex].name` that doesn't\nreflect the actual
column name for ES|QL, in fact that name reflect the\nvisualization
label name for the time dimension. In particular, before\nthe fix, that
timeFieldName was set as the axis name (e.g.`@timestamp\nevery 5 minute`
) and cause the time range filter to fail to be\nextracted from the
filters list.\n\nA combination of two PRs caused this to be now anymore
the correct\nbehaviour:\n- this PR
#196049 introduced the\nuse of the
`souceField` as field name for the creation of filter from a\nrange\n-
this PR #217719
instead\nintroduced the use of `sourceField` also for ESQL datasources.
This\nfield points to the actual column name described in the ESQL
query.\n\nBoth PR causes the `extractTimeFilter` to fail to extract
the\ntimeFilter, pushing the filter up to the filter pills.\n\n### Side
notes\n\nThis could be probably fixed in other ways, like by avoiding
using the\n`sourceField` in ESQL, or by using only the column.name in
the filter\ncreation, or by avoiding checking the `timeFieldName`
against the\n`query.range` key (not really sure why this is required).
In general the\nproblem here is that there is a low confidence on what
these\nfields/params are supposed to be and which is supposted to be
the\nidentifiers to use everywhere. For example the column ids reflects
only\na link between the rows and the column descriptions, the name is
the\nassociated label, but can we rely on that label for filtering? i
believe\nwe need a stronger connection with the data and the actual
original\nsource field or column identifier is a better choice.\nI
believe a valid subsequent task
is\nhttps://github.com//issues/189044","sha":"eb4ba962ec29256f086ade49d04150c3aec1789b"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/221322","number":221322,"mergeCommit":{"message":"[ES|QL]
Use correct timeFieldName for time brush filter (#221322)\n\n##
Summary\n\nfix #221241\n\n## Bug and fix descriptions\n\nThe logic that
applies a time filter by updating the time picker vs\nadding it as a
filter pill in the filter bar is described
here:\n\nhttps://github.com/elastic/kibana/blob/e877bafa3e4725d3e7cfd3b2ca0be4bc6d88a0b9/src/platform/plugins/shared/unified_search/public/actions/apply_filter_action/apply_filter_action.tsx#L107-L114\n\nThe
`extractTimeFilter` function extracts the `timeRangeFilter` only if\nthe
`timeFieldName === keys(filter.query.range)[0]` . The problem was\nthat
the first key of `query.range` was different than the\n`timeFieldName`.
That `timeFieldName` in the ESQL world was wrongly\napplied via the `
table.columns[xAxisColumnIndex].name` that doesn't\nreflect the actual
column name for ES|QL, in fact that name reflect the\nvisualization
label name for the time dimension. In particular, before\nthe fix, that
timeFieldName was set as the axis name (e.g.`@timestamp\nevery 5 minute`
) and cause the time range filter to fail to be\nextracted from the
filters list.\n\nA combination of two PRs caused this to be now anymore
the correct\nbehaviour:\n- this PR
#196049 introduced the\nuse of the
`souceField` as field name for the creation of filter from a\nrange\n-
this PR #217719
instead\nintroduced the use of `sourceField` also for ESQL datasources.
This\nfield points to the actual column name described in the ESQL
query.\n\nBoth PR causes the `extractTimeFilter` to fail to extract
the\ntimeFilter, pushing the filter up to the filter pills.\n\n### Side
notes\n\nThis could be probably fixed in other ways, like by avoiding
using the\n`sourceField` in ESQL, or by using only the column.name in
the filter\ncreation, or by avoiding checking the `timeFieldName`
against the\n`query.range` key (not really sure why this is required).
In general the\nproblem here is that there is a low confidence on what
these\nfields/params are supposed to be and which is supposted to be
the\nidentifiers to use everywhere. For example the column ids reflects
only\na link between the rows and the column descriptions, the name is
the\nassociated label, but can we rely on that label for filtering? i
believe\nwe need a stronger connection with the data and the actual
original\nsource field or column identifier is a better choice.\nI
believe a valid subsequent task
is\nhttps://github.com//issues/189044","sha":"eb4ba962ec29256f086ade49d04150c3aec1789b"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…lization (elastic#217719)

## Summary

Closes elastic#208854 

This adds a tooltip action and a context menu action to the **ES|QL**
panel type allowing the user to create an Elasticsearch Query rule from
the visualization on the panel. Lens panels are currently not supported.

### Tooltip action
<img width="1081" alt="Screenshot 2025-04-09 at 11 06 25 AM"
src="https://github.com/user-attachments/assets/3315cd9f-6dda-44b0-8e7c-eb295c08b89f"
/>

Prefill the time field from the chart, and the alert window from the
dashboard's current displayed time range:
<img width="588" alt="Screenshot 2025-04-09 at 11 06 46 AM"
src="https://github.com/user-attachments/assets/c06a99ab-ce67-4c88-b4ff-dd6edd9e864a"
/>

Add an extra clause to the end of the visualization's ES|QL query to set
an alert threshold based on the data point that the user clicked on:
<img width="562" alt="Screenshot 2025-04-09 at 11 06 55 AM"
src="https://github.com/user-attachments/assets/27a6552b-b5be-4cb7-80aa-74c683b93ae4"
/>



### Context menu action
<img width="1107" alt="Screenshot 2025-04-09 at 11 07 41 AM"
src="https://github.com/user-attachments/assets/fe6d7f76-68e6-4345-b2a8-e47d1363d7d8"
/>

Creating a rule from the context menu instead of from a tooltip doesn't
give us a pre-filled threshold value, so we ask the user to specify it:
<img width="563" alt="Screenshot 2025-04-09 at 11 07 48 AM"
src="https://github.com/user-attachments/assets/83a7f51b-bb87-4637-b602-b169b3f0a375"
/>

### Supported cases
#### Breakdowns and split values:
<img width="1077" alt="Screenshot 2025-04-09 at 11 14 47 AM"
src="https://github.com/user-attachments/assets/d691d247-27af-45d1-82ac-b50aaa20e9f9"
/>
<img width="556" alt="Screenshot 2025-04-09 at 11 14 56 AM"
src="https://github.com/user-attachments/assets/3b97f08d-00b5-464d-8700-59d6d4a4d473"
/>

#### Escaping column names
<img width="668" alt="Screenshot 2025-04-09 at 11 18 08 AM"
src="https://github.com/user-attachments/assets/ad98cb2a-d167-4175-acd5-bc81822a2d1c"
/>
<img width="574" alt="Screenshot 2025-04-09 at 11 18 42 AM"
src="https://github.com/user-attachments/assets/d6805e93-2592-4a66-b59e-7ceffca579c7"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note
Adds the Create alert rule action to ES|QL dashboard panels, usable from
the panel context menu or by right-clicking a data point on the
visualization. This allows you to generate an alert when the data on the
chart crosses a certain threshold.

---------

Co-authored-by: mbondyra <marta.bondyra@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Co-authored-by: dej611 <dej611@gmail.com>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
## Summary

fix elastic#221241

## Bug and fix descriptions

The logic that applies a time filter by updating the time picker vs
adding it as a filter pill in the filter bar is described here:

https://github.com/elastic/kibana/blob/e877bafa3e4725d3e7cfd3b2ca0be4bc6d88a0b9/src/platform/plugins/shared/unified_search/public/actions/apply_filter_action/apply_filter_action.tsx#L107-L114

The `extractTimeFilter` function extracts the `timeRangeFilter` only if
the `timeFieldName === keys(filter.query.range)[0]` . The problem was
that the first key of `query.range` was different than the
`timeFieldName`. That `timeFieldName` in the ESQL world was wrongly
applied via the ` table.columns[xAxisColumnIndex].name` that doesn't
reflect the actual column name for ES|QL, in fact that name reflect the
visualization label name for the time dimension. In particular, before
the fix, that timeFieldName was set as the axis name (e.g.`@timestamp
every 5 minute` ) and cause the time range filter to fail to be
extracted from the filters list.

A combination of two PRs caused this to be now anymore the correct
behaviour:
- this PR elastic#196049 introduced the
use of the `souceField` as field name for the creation of filter from a
range
- this PR elastic#217719 instead
introduced the use of `sourceField` also for ESQL datasources. This
field points to the actual column name described in the ESQL query.

Both PR causes the `extractTimeFilter` to fail to extract the
timeFilter, pushing the filter up to the filter pills.

### Side notes

This could be probably fixed in other ways, like by avoiding using the
`sourceField` in ESQL, or by using only the column.name in the filter
creation, or by avoiding checking the `timeFieldName` against the
`query.range` key (not really sure why this is required). In general the
problem here is that there is a low confidence on what these
fields/params are supposed to be and which is supposted to be the
identifiers to use everywhere. For example the column ids reflects only
a link between the rows and the column descriptions, the name is the
associated label, but can we rely on that label for filtering? i believe
we need a stronger connection with the data and the actual original
source field or column identifier is a better choice.
I believe a valid subsequent task is
elastic#189044
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…lization (elastic#217719)

## Summary

Closes elastic#208854 

This adds a tooltip action and a context menu action to the **ES|QL**
panel type allowing the user to create an Elasticsearch Query rule from
the visualization on the panel. Lens panels are currently not supported.

### Tooltip action
<img width="1081" alt="Screenshot 2025-04-09 at 11 06 25 AM"
src="https://github.com/user-attachments/assets/3315cd9f-6dda-44b0-8e7c-eb295c08b89f"
/>

Prefill the time field from the chart, and the alert window from the
dashboard's current displayed time range:
<img width="588" alt="Screenshot 2025-04-09 at 11 06 46 AM"
src="https://github.com/user-attachments/assets/c06a99ab-ce67-4c88-b4ff-dd6edd9e864a"
/>

Add an extra clause to the end of the visualization's ES|QL query to set
an alert threshold based on the data point that the user clicked on:
<img width="562" alt="Screenshot 2025-04-09 at 11 06 55 AM"
src="https://github.com/user-attachments/assets/27a6552b-b5be-4cb7-80aa-74c683b93ae4"
/>



### Context menu action
<img width="1107" alt="Screenshot 2025-04-09 at 11 07 41 AM"
src="https://github.com/user-attachments/assets/fe6d7f76-68e6-4345-b2a8-e47d1363d7d8"
/>

Creating a rule from the context menu instead of from a tooltip doesn't
give us a pre-filled threshold value, so we ask the user to specify it:
<img width="563" alt="Screenshot 2025-04-09 at 11 07 48 AM"
src="https://github.com/user-attachments/assets/83a7f51b-bb87-4637-b602-b169b3f0a375"
/>

### Supported cases
#### Breakdowns and split values:
<img width="1077" alt="Screenshot 2025-04-09 at 11 14 47 AM"
src="https://github.com/user-attachments/assets/d691d247-27af-45d1-82ac-b50aaa20e9f9"
/>
<img width="556" alt="Screenshot 2025-04-09 at 11 14 56 AM"
src="https://github.com/user-attachments/assets/3b97f08d-00b5-464d-8700-59d6d4a4d473"
/>

#### Escaping column names
<img width="668" alt="Screenshot 2025-04-09 at 11 18 08 AM"
src="https://github.com/user-attachments/assets/ad98cb2a-d167-4175-acd5-bc81822a2d1c"
/>
<img width="574" alt="Screenshot 2025-04-09 at 11 18 42 AM"
src="https://github.com/user-attachments/assets/d6805e93-2592-4a66-b59e-7ceffca579c7"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note
Adds the Create alert rule action to ES|QL dashboard panels, usable from
the panel context menu or by right-clicking a data point on the
visualization. This allows you to generate an alert when the data on the
chart crosses a certain threshold.

---------

Co-authored-by: mbondyra <marta.bondyra@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Co-authored-by: dej611 <dej611@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:build-webpack-bundle-analyzer Feature:Alerting/RulesManagement Issues related to the Rules Management UX Feature:Dashboard Dashboard related features Feature:ES|QL ES|QL related features in Kibana Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:large Large Level of Effort release_note:feature Makes this part of the condensed release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.0