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

[Custom threshold][Logs Explorer] Fix the issue with saving default prefilled filters in the custom threshold rule on the Logs Explorer page #183900

Merged
merged 8 commits into from
May 23, 2024

Conversation

maryam-saeidi
Copy link
Member

@maryam-saeidi maryam-saeidi commented May 21, 2024

Fixes #183710

Summary

This PR fixes the issue of saving prefilled filters in the custom threshold rule by using getSearchConfiguration every time the serachConfiguration is saved in rule parameters. Now, getSearchConfiguration does two things:

  1. Ensure the query has the correct type (Qurey), or it will be set as the default query.
  2. Adjust filters by removing $state and only keeping meta and query

Also, I adjusted the related type to exclude $state.

How to test

Screen.Recording.2024-05-22.at.18.mp4

@maryam-saeidi maryam-saeidi added bug Fixes for quality problems that affect the customer experience release_note:fix backport:prev-minor Backport to the previous minor version (i.e. one version back from main) labels May 21, 2024
@maryam-saeidi maryam-saeidi self-assigned this May 21, 2024
@apmmachine
Copy link
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!)

@maryam-saeidi maryam-saeidi marked this pull request as ready for review May 21, 2024 09:27
@maryam-saeidi maryam-saeidi requested a review from a team as a code owner May 21, 2024 09:27
@maryam-saeidi
Copy link
Member Author

@thomheymann I saw you were adding a functional test in this PR. Did you also work on adding a functional test to create a custom threshold rule with prefilled filters? If yes, was there an issue with adding it? Maybe I can help with fixing it since having such a test would be very useful.

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-management Observability Management User Experience Team labels May 21, 2024
@elasticmachine
Copy link
Contributor

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

@fkanout fkanout self-requested a review May 22, 2024 09:05
Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

@maryam-saeidi, when I select All logs and then create a rule, I see no data in the rule creation form, while there is data in the Log Explorer. 🤔
Screenshot 2024-05-22 at 13 36 41

Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

Is it intentional not to prefill the time range? e.g. the time range in the Log Explorer is 15 minutes, and when I create a rule, it's 1 minute

@maryam-saeidi
Copy link
Member Author

Is it intentional not to prefill the time range? e.g. the time range in the Log Explorer is 15 minutes, and when I create a rule, it's 1 minute

Yes, it is intentional, the logs explorer team didn't add such a logic.

Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

I approve the PR to unblock you @maryam-saeidi, and leave it to you handle the issue I mentioned in this one or create a different one.

@maryam-saeidi
Copy link
Member Author

@maryam-saeidi, when I select All logs and then create a rule, I see no data in the rule creation form, while there is data in the Log Explorer. 🤔 Screenshot 2024-05-22 at 13 36 41

Thanks for creating a ticket for it. I saw it once, but when I ran my Kibana server again, I wasn't able to reproduce it. I also checked edge-lite, and it worked fine there. I'll go ahead and merge this PR, and we can check the other issue separately.

@kibana-ci
Copy link
Collaborator

kibana-ci commented May 22, 2024

💚 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
observability 289.6KB 289.6KB +73.0B

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5412 +5412
total size - 8.8MB +8.8MB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maryam-saeidi

@maryam-saeidi maryam-saeidi merged commit 4ccd47d into elastic:main May 23, 2024
21 checks passed
@maryam-saeidi maryam-saeidi changed the title [Custom threshold][Logs Explorer] Fix an issue with saving prefilled filters in the custom threshold rule on the Logs Explorer page [Custom threshold][Logs Explorer] Fix the issue with saving default prefilled filters in the custom threshold rule on the Logs Explorer page May 23, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 23, 2024
…filters in the custom threshold rule on the Logs Explorer page (elastic#183900)

Fixes elastic#183710

## Summary

This PR fixes the issue of saving prefilled filters in the custom
threshold rule by using `getSearchConfiguration` every time the
serachConfiguration is saved in rule parameters. Now,
`getSearchConfiguration` does two things:
1. Ensure the query has the correct type (`Qurey`), or it will be set as
the default query.
2. Adjust filters by removing `$state` and only keeping `meta` and
`query`

Also, I adjusted the related type to exclude `$state`.

### How to test

https://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe
(cherry picked from commit 4ccd47d)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.14

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

Questions ?

Please refer to the Backport tool documentation

@maryam-saeidi maryam-saeidi deleted the 183710-fix-prefill-filters branch May 23, 2024 07:31
kibanamachine added a commit that referenced this pull request May 23, 2024
…filled filters in the custom threshold rule on the Logs Explorer page (#183900) (#184087)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Custom threshold][Logs Explorer] Fix an issue with saving prefilled
filters in the custom threshold rule on the Logs Explorer page
(#183900)](#183900)

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

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

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2024-05-23T07:16:07Z","message":"[Custom
threshold][Logs Explorer] Fix an issue with saving prefilled filters in
the custom threshold rule on the Logs Explorer page (#183900)\n\nFixes
#183710\r\n\r\n## Summary\r\n\r\nThis PR fixes the issue of saving
prefilled filters in the custom\r\nthreshold rule by using
`getSearchConfiguration` every time the\r\nserachConfiguration is saved
in rule parameters. Now,\r\n`getSearchConfiguration` does two
things:\r\n1. Ensure the query has the correct type (`Qurey`), or it
will be set as\r\nthe default query.\r\n2. Adjust filters by removing
`$state` and only keeping `meta` and\r\n`query`\r\n\r\nAlso, I adjusted
the related type to exclude `$state`.\r\n\r\n### How to
test\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe","sha":"4ccd47d90e7b812d0d405cdd906a8b775757c1a4","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.15.0"],"title":"[Custom
threshold][Logs Explorer] Fix an issue with saving prefilled filters in
the custom threshold rule on the Logs Explorer
page","number":183900,"url":"#183900
threshold][Logs Explorer] Fix an issue with saving prefilled filters in
the custom threshold rule on the Logs Explorer page (#183900)\n\nFixes
#183710\r\n\r\n## Summary\r\n\r\nThis PR fixes the issue of saving
prefilled filters in the custom\r\nthreshold rule by using
`getSearchConfiguration` every time the\r\nserachConfiguration is saved
in rule parameters. Now,\r\n`getSearchConfiguration` does two
things:\r\n1. Ensure the query has the correct type (`Qurey`), or it
will be set as\r\nthe default query.\r\n2. Adjust filters by removing
`$state` and only keeping `meta` and\r\n`query`\r\n\r\nAlso, I adjusted
the related type to exclude `$state`.\r\n\r\n### How to
test\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe","sha":"4ccd47d90e7b812d0d405cdd906a8b775757c1a4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#183900
threshold][Logs Explorer] Fix an issue with saving prefilled filters in
the custom threshold rule on the Logs Explorer page (#183900)\n\nFixes
#183710\r\n\r\n## Summary\r\n\r\nThis PR fixes the issue of saving
prefilled filters in the custom\r\nthreshold rule by using
`getSearchConfiguration` every time the\r\nserachConfiguration is saved
in rule parameters. Now,\r\n`getSearchConfiguration` does two
things:\r\n1. Ensure the query has the correct type (`Qurey`), or it
will be set as\r\nthe default query.\r\n2. Adjust filters by removing
`$state` and only keeping `meta` and\r\n`query`\r\n\r\nAlso, I adjusted
the related type to exclude `$state`.\r\n\r\n### How to
test\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe","sha":"4ccd47d90e7b812d0d405cdd906a8b775757c1a4"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
rshen91 pushed a commit to rshen91/kibana that referenced this pull request May 30, 2024
…filters in the custom threshold rule on the Logs Explorer page (elastic#183900)

Fixes elastic#183710

## Summary

This PR fixes the issue of saving prefilled filters in the custom
threshold rule by using `getSearchConfiguration` every time the
serachConfiguration is saved in rule parameters. Now,
`getSearchConfiguration` does two things:
1. Ensure the query has the correct type (`Qurey`), or it will be set as
the default query.
2. Adjust filters by removing `$state` and only keeping `meta` and
`query`

Also, I adjusted the related type to exclude `$state`.

### How to test



https://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience ci:project-deploy-observability Create an Observability project release_note:fix Team:obs-ux-management Observability Management User Experience Team v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Custom threshold][Logs Explorer] Issue with saving prefilled filters in custom threshold rule
6 participants