Skip to content
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

[ML][ES|QL] Adds query guardrails and technical preview badge to ES|QL data visualizer #200325

Merged
merged 9 commits into from
Nov 19, 2024

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Nov 17, 2024

Summary

Adds extra guardrails to the searches, plus the technical preview badge, to the ES|QL data visualizer. \

The extra safety guards applied are:

  • Lowers the limit of # of rows sampled to 5000
  • Changes the pagination to 10 by default, and only allows 10 to 25 rows visible concurrently
  • Hides distribution charts by default
  • Always have frozen tier excluded in the queries
Screenshot 2024-11-16 at 18 26 20
Screen.Recording.2024-11-16.at.17.42.54.mov

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_node:* label is applied per the guidelines

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@qn895 qn895 self-assigned this Nov 17, 2024
@qn895 qn895 force-pushed the ml-esql-data-viz-tech-preview branch from 38b4b35 to 0a07a39 Compare November 17, 2024 00:37
@qn895 qn895 force-pushed the ml-esql-data-viz-tech-preview branch from 0a07a39 to 61406f5 Compare November 17, 2024 00:38
@qn895
Copy link
Member Author

qn895 commented Nov 17, 2024

/ci

Comment on lines 234 to 248
if (filter.bool && Array.isArray(filter.bool?.must_not)) {
filter.bool.must_not.push({
term: {
_tier: 'data_frozen',
},
});
} else {
filter.bool = {
must_not: [
{
term: { _tier: 'data_frozen' },
},
],
};
}
Copy link
Member

@jgowdyelastic jgowdyelastic Nov 18, 2024

Choose a reason for hiding this comment

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

If a bool object already exists containing a must but not must_not this will hit the else clause where a new bool object is created, wiping out the exiting must.

I think a series of ifs might be safer. something like

if (filter.bool === undefined) {
  filter.bool = Object.create(null);
}

if (filter.bool.must_not === undefined) {
  filter.bool.must_not = [];
}

filter.bool.must_not.push({
  term: { _tier: 'data_frozen' },
  })

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated here 83ff92c (#200325)

@qn895 qn895 marked this pull request as ready for review November 18, 2024 15:23
@qn895 qn895 requested a review from a team as a code owner November 18, 2024 15:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@qn895 qn895 added the release_note:skip Skip the PR/issue when compiling release notes label Nov 18, 2024
@peteharverson peteharverson added release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Nov 18, 2024
@peteharverson peteharverson changed the title [ML][ES|QL] Add technical preview badge to ES|QL data visualizer [ML][ES|QL] Adds query guardrails and technical preview badge to ES|QL data visualizer Nov 18, 2024
Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM

@qn895 qn895 enabled auto-merge (squash) November 18, 2024 19:11
@jgowdyelastic jgowdyelastic added the backport:version Backport to applied version labels label Nov 18, 2024
Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@qn895 qn895 merged commit 94aaed3 into elastic:main Nov 19, 2024
24 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
dataVisualizer 614.0KB 614.5KB +510.0B
ml 4.7MB 4.7MB +1.1KB
total +1.6KB

Page load bundle

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

id before after diff
dataVisualizer 24.5KB 24.5KB -70.0B

History

cc @qn895

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2024
…L data visualizer (elastic#200325)

## Summary

Adds extra guardrails to the searches, plus the technical preview badge,
to the ES|QL data visualizer. \

The extra safety guards applied are:
- Lowers the limit of # of rows sampled to 5000
- Changes the pagination to 10 by default, and only allows 10 to 25 rows
visible concurrently
- Hides distribution charts by default
- Always have frozen tier excluded in the queries

<img width="1164" alt="Screenshot 2024-11-16 at 18 26 20"
src="https://github.com/user-attachments/assets/a558fdfa-189a-4ba9-b038-8d14df4594be">

https://github.com/user-attachments/assets/488f44dd-4a3c-48c7-8416-5091b614edfd

### 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/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_node:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

(cherry picked from commit 94aaed3)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 19, 2024
…o ES|QL data visualizer (#200325) (#200677)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML][ES|QL] Adds query guardrails and technical preview badge to
ES|QL data visualizer
(#200325)](#200325)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Quynh Nguyen
(Quinn)","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-19T08:11:46Z","message":"[ML][ES|QL]
Adds query guardrails and technical preview badge to ES|QL data
visualizer (#200325)\n\n## Summary\r\n\r\nAdds extra guardrails to the
searches, plus the technical preview badge,\r\nto the ES|QL data
visualizer. \\\r\n\r\nThe extra safety guards applied are:\r\n- Lowers
the limit of # of rows sampled to 5000\r\n- Changes the pagination to 10
by default, and only allows 10 to 25 rows\r\nvisible concurrently\r\n-
Hides distribution charts by default\r\n- Always have frozen tier
excluded in the queries\r\n\r\n<img width=\"1164\" alt=\"Screenshot
2024-11-16 at 18 26
20\"\r\nsrc=\"https://github.com/user-attachments/assets/a558fdfa-189a-4ba9-b038-8d14df4594be\">\r\n\r\n\r\nhttps://github.com/user-attachments/assets/488f44dd-4a3c-48c7-8416-5091b614edfd\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_node:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [ ] [See some
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\r\n-
[ ]
...","sha":"94aaed3b139b0bdeeb581954053871d75c098a4a","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:File
and Index Data
Viz","v9.0.0","backport:version","v8.17.0"],"title":"[ML][ES|QL] Adds
query guardrails and technical preview badge to ES|QL data
visualizer","number":200325,"url":"https://github.com/elastic/kibana/pull/200325","mergeCommit":{"message":"[ML][ES|QL]
Adds query guardrails and technical preview badge to ES|QL data
visualizer (#200325)\n\n## Summary\r\n\r\nAdds extra guardrails to the
searches, plus the technical preview badge,\r\nto the ES|QL data
visualizer. \\\r\n\r\nThe extra safety guards applied are:\r\n- Lowers
the limit of # of rows sampled to 5000\r\n- Changes the pagination to 10
by default, and only allows 10 to 25 rows\r\nvisible concurrently\r\n-
Hides distribution charts by default\r\n- Always have frozen tier
excluded in the queries\r\n\r\n<img width=\"1164\" alt=\"Screenshot
2024-11-16 at 18 26
20\"\r\nsrc=\"https://github.com/user-attachments/assets/a558fdfa-189a-4ba9-b038-8d14df4594be\">\r\n\r\n\r\nhttps://github.com/user-attachments/assets/488f44dd-4a3c-48c7-8416-5091b614edfd\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_node:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [ ] [See some
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\r\n-
[ ]
...","sha":"94aaed3b139b0bdeeb581954053871d75c098a4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200325","number":200325,"mergeCommit":{"message":"[ML][ES|QL]
Adds query guardrails and technical preview badge to ES|QL data
visualizer (#200325)\n\n## Summary\r\n\r\nAdds extra guardrails to the
searches, plus the technical preview badge,\r\nto the ES|QL data
visualizer. \\\r\n\r\nThe extra safety guards applied are:\r\n- Lowers
the limit of # of rows sampled to 5000\r\n- Changes the pagination to 10
by default, and only allows 10 to 25 rows\r\nvisible concurrently\r\n-
Hides distribution charts by default\r\n- Always have frozen tier
excluded in the queries\r\n\r\n<img width=\"1164\" alt=\"Screenshot
2024-11-16 at 18 26
20\"\r\nsrc=\"https://github.com/user-attachments/assets/a558fdfa-189a-4ba9-b038-8d14df4594be\">\r\n\r\n\r\nhttps://github.com/user-attachments/assets/488f44dd-4a3c-48c7-8416-5091b614edfd\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_node:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [ ] [See some
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\r\n-
[ ]
...","sha":"94aaed3b139b0bdeeb581954053871d75c098a4a"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Quynh Nguyen (Quinn) <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…L data visualizer (elastic#200325)

## Summary

Adds extra guardrails to the searches, plus the technical preview badge,
to the ES|QL data visualizer. \

The extra safety guards applied are:
- Lowers the limit of # of rows sampled to 5000
- Changes the pagination to 10 by default, and only allows 10 to 25 rows
visible concurrently
- Hides distribution charts by default
- Always have frozen tier excluded in the queries

<img width="1164" alt="Screenshot 2024-11-16 at 18 26 20"
src="https://github.com/user-attachments/assets/a558fdfa-189a-4ba9-b038-8d14df4594be">


https://github.com/user-attachments/assets/488f44dd-4a3c-48c7-8416-5091b614edfd



### 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/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_node:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
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 Feature:File and Index Data Viz ML file and index data visualizer :ml release_note:fix v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants