[Watcher] Fix watches table#218853
Merged
ElenaStoeva merged 10 commits intoelastic:mainfrom Apr 28, 2025
Merged
Conversation
Contributor
Author
|
/ci |
Contributor
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
Contributor
Author
|
/ci |
Contributor
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @ElenaStoeva |
mattkime
approved these changes
Apr 25, 2025
Contributor
mattkime
left a comment
There was a problem hiding this comment.
Code changes look good and work well!
Contributor
|
Starting backport for target branches: 8.18, 8.19, 9.0 |
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 28, 2025
Fixes elastic#218341 ## Summary This PR fixes the watches table where only up to 10 watches were previously displayed because the Query Watch API returns maximum 10 watches by default. To fix this and to avoid performance issues for clusters with a large number of watches, we use pagination to only fetch the watches for the current page. **Limitations:** - The Query Watch API only allows sorting by `_id` and `metadata.*` fields. However, we cannot allow sorting by ID in the table because this requires enabling the `indices.id_field_data.enabled` cluster setting, which is disabled by default in the cluster. We can only sort by Name because the name is part of the `metadata` property. Therefore, we need to remove sorting for all columns but the Name. - We cannot utilize the native behavior of the Search bar where the table would filter all items by itself, since in this case it would only filter the current page of watches. We need to pass the query to the Query Watches API. However, again only the `_id` and `metadata.*` fields can be searched. Additionally, for `_id` we cannot use a wildcard query so the user would need to input the whole id for the requested watch to be displayed. For name, we can use a wildcard query so searching by a substring of a name should work. **How to test:** 1. Create more than 10 watches through the UI or with a Console request: ``` PUT _watcher/watch/{id} { "metadata": { "name": "test-watch-{id}", "xpack": { "type": "json" } }, "trigger": { "schedule": { "interval": "30m" } } } ``` 2. Verify that all watches can be viewed in the table and that they can be sorted by Name and search by Name or ID. https://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me> (cherry picked from commit d9c4817)
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 28, 2025
Fixes elastic#218341 ## Summary This PR fixes the watches table where only up to 10 watches were previously displayed because the Query Watch API returns maximum 10 watches by default. To fix this and to avoid performance issues for clusters with a large number of watches, we use pagination to only fetch the watches for the current page. **Limitations:** - The Query Watch API only allows sorting by `_id` and `metadata.*` fields. However, we cannot allow sorting by ID in the table because this requires enabling the `indices.id_field_data.enabled` cluster setting, which is disabled by default in the cluster. We can only sort by Name because the name is part of the `metadata` property. Therefore, we need to remove sorting for all columns but the Name. - We cannot utilize the native behavior of the Search bar where the table would filter all items by itself, since in this case it would only filter the current page of watches. We need to pass the query to the Query Watches API. However, again only the `_id` and `metadata.*` fields can be searched. Additionally, for `_id` we cannot use a wildcard query so the user would need to input the whole id for the requested watch to be displayed. For name, we can use a wildcard query so searching by a substring of a name should work. **How to test:** 1. Create more than 10 watches through the UI or with a Console request: ``` PUT _watcher/watch/{id} { "metadata": { "name": "test-watch-{id}", "xpack": { "type": "json" } }, "trigger": { "schedule": { "interval": "30m" } } } ``` 2. Verify that all watches can be viewed in the table and that they can be sorted by Name and search by Name or ID. https://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me> (cherry picked from commit d9c4817)
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 28, 2025
Fixes elastic#218341 ## Summary This PR fixes the watches table where only up to 10 watches were previously displayed because the Query Watch API returns maximum 10 watches by default. To fix this and to avoid performance issues for clusters with a large number of watches, we use pagination to only fetch the watches for the current page. **Limitations:** - The Query Watch API only allows sorting by `_id` and `metadata.*` fields. However, we cannot allow sorting by ID in the table because this requires enabling the `indices.id_field_data.enabled` cluster setting, which is disabled by default in the cluster. We can only sort by Name because the name is part of the `metadata` property. Therefore, we need to remove sorting for all columns but the Name. - We cannot utilize the native behavior of the Search bar where the table would filter all items by itself, since in this case it would only filter the current page of watches. We need to pass the query to the Query Watches API. However, again only the `_id` and `metadata.*` fields can be searched. Additionally, for `_id` we cannot use a wildcard query so the user would need to input the whole id for the requested watch to be displayed. For name, we can use a wildcard query so searching by a substring of a name should work. **How to test:** 1. Create more than 10 watches through the UI or with a Console request: ``` PUT _watcher/watch/{id} { "metadata": { "name": "test-watch-{id}", "xpack": { "type": "json" } }, "trigger": { "schedule": { "interval": "30m" } } } ``` 2. Verify that all watches can be viewed in the table and that they can be sorted by Name and search by Name or ID. https://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me> (cherry picked from commit d9c4817)
Contributor
💚 All backports created successfully
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
Apr 28, 2025
# Backport This will backport the following commits from `main` to `9.0`: - [[Watcher] Fix watches table (#218853)](#218853) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-28T13:07:42Z","message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Watcher","Team:Kibana Management","release_note:skip","backport:prev-minor","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[Watcher] Fix watches table","number":218853,"url":"https://github.com/elastic/kibana/pull/218853","mergeCommit":{"message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/218853","number":218853,"mergeCommit":{"message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me>
kibanamachine
added a commit
that referenced
this pull request
Apr 28, 2025
# Backport This will backport the following commits from `main` to `8.19`: - [[Watcher] Fix watches table (#218853)](#218853) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-28T13:07:42Z","message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Watcher","Team:Kibana Management","release_note:skip","backport:prev-minor","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[Watcher] Fix watches table","number":218853,"url":"https://github.com/elastic/kibana/pull/218853","mergeCommit":{"message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/218853","number":218853,"mergeCommit":{"message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me>
kibanamachine
added a commit
that referenced
this pull request
Apr 28, 2025
# Backport This will backport the following commits from `main` to `8.18`: - [[Watcher] Fix watches table (#218853)](#218853) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-28T13:07:42Z","message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Watcher","Team:Kibana Management","release_note:skip","backport:prev-minor","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[Watcher] Fix watches table","number":218853,"url":"https://github.com/elastic/kibana/pull/218853","mergeCommit":{"message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/218853","number":218853,"mergeCommit":{"message":"[Watcher] Fix watches table (#218853)\n\nFixes https://github.com/elastic/kibana/issues/218341\n\n## Summary\n\nThis PR fixes the watches table where only up to 10 watches were\npreviously displayed because the Query Watch API returns maximum 10\nwatches by default. To fix this and to avoid performance issues for\nclusters with a large number of watches, we use pagination to only fetch\nthe watches for the current page.\n\n**Limitations:**\n- The Query Watch API only allows sorting by `_id` and `metadata.*`\nfields. However, we cannot allow sorting by ID in the table because this\nrequires enabling the `indices.id_field_data.enabled` cluster setting,\nwhich is disabled by default in the cluster. We can only sort by Name\nbecause the name is part of the `metadata` property. Therefore, we need\nto remove sorting for all columns but the Name.\n- We cannot utilize the native behavior of the Search bar where the\ntable would filter all items by itself, since in this case it would only\nfilter the current page of watches. We need to pass the query to the\nQuery Watches API. However, again only the `_id` and `metadata.*` fields\ncan be searched. Additionally, for `_id` we cannot use a wildcard query\nso the user would need to input the whole id for the requested watch to\nbe displayed. For name, we can use a wildcard query so searching by a\nsubstring of a name should work.\n\n**How to test:**\n1. Create more than 10 watches through the UI or with a Console request:\n\n```\nPUT _watcher/watch/{id}\n{\n \"metadata\": {\n \"name\": \"test-watch-{id}\",\n \"xpack\": {\n \"type\": \"json\"\n }\n },\n \"trigger\": {\n \"schedule\": {\n \"interval\": \"30m\"\n }\n }\n}\n```\n2. Verify that all watches can be viewed in the table and that they can\nbe sorted by Name and search by Name or ID.\n\n\n\n\n\nhttps://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Matthew Kime <matt@mattki.me>","sha":"d9c481799f0edb3088595d21e4d7615b1a4e12f6"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me>
This was referenced May 28, 2025
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
May 29, 2025
Fixes elastic#218341 ## Summary This PR fixes the watches table where only up to 10 watches were previously displayed because the Query Watch API returns maximum 10 watches by default. To fix this and to avoid performance issues for clusters with a large number of watches, we use pagination to only fetch the watches for the current page. **Limitations:** - The Query Watch API only allows sorting by `_id` and `metadata.*` fields. However, we cannot allow sorting by ID in the table because this requires enabling the `indices.id_field_data.enabled` cluster setting, which is disabled by default in the cluster. We can only sort by Name because the name is part of the `metadata` property. Therefore, we need to remove sorting for all columns but the Name. - We cannot utilize the native behavior of the Search bar where the table would filter all items by itself, since in this case it would only filter the current page of watches. We need to pass the query to the Query Watches API. However, again only the `_id` and `metadata.*` fields can be searched. Additionally, for `_id` we cannot use a wildcard query so the user would need to input the whole id for the requested watch to be displayed. For name, we can use a wildcard query so searching by a substring of a name should work. **How to test:** 1. Create more than 10 watches through the UI or with a Console request: ``` PUT _watcher/watch/{id} { "metadata": { "name": "test-watch-{id}", "xpack": { "type": "json" } }, "trigger": { "schedule": { "interval": "30m" } } } ``` 2. Verify that all watches can be viewed in the table and that they can be sorted by Name and search by Name or ID. https://github.com/user-attachments/assets/6c812c5d-51e9-472c-a4d9-b1035843b9bb --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthew Kime <matt@mattki.me>
ElenaStoeva
added a commit
to ElenaStoeva/kibana
that referenced
this pull request
Jun 13, 2025
This reverts commit d9c4817.
ElenaStoeva
added a commit
that referenced
this pull request
Jun 16, 2025
Fixes #221820 Fixes #220879 ## Summary This PR reverts #204296 and #218853 as these PRs caused issues in the UI due to limitations in the Query Watches API. Therefore, we are temporarily reverting back to fetching watches through the `.watches` system index until we have better support from the Query Watches API. **How to test:** 1. Start Es with `yarn es snapshot --license=trial` and Kibana with `yarn start` (no need to test in serverless as Watcher is not available there. 2. Navigate to Stack Management -> Watcher and create multiple watches (the more, the better). Make sure you create watches of different types (advanced/json or threshold), watches with or without names, etc. There are different watches and use cases described in the [documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher). Also, adding sample data sets is helpful so that you can get watches to execute and have values under the "Condition last met" and "Last checked" columns. 3. After creating various watches, open the table with watches and make sure that all functionalities work correctly. For example: - All watches are displayed, check with >10 watches and different page sizes. - Sorting works for all columns. - Search bar works as expected and searching by partial id is supported. - Deleting watches updates the table correctly. https://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80 ## Release notes: This update resolves multiple issues in Watcher UI that were introduced in 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying more than 10 watches, an error banner appearing unexpectedly in certain scenarios, and the search bar functionality not working as expected.
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jun 16, 2025
Fixes elastic#221820 Fixes elastic#220879 ## Summary This PR reverts elastic#204296 and elastic#218853 as these PRs caused issues in the UI due to limitations in the Query Watches API. Therefore, we are temporarily reverting back to fetching watches through the `.watches` system index until we have better support from the Query Watches API. **How to test:** 1. Start Es with `yarn es snapshot --license=trial` and Kibana with `yarn start` (no need to test in serverless as Watcher is not available there. 2. Navigate to Stack Management -> Watcher and create multiple watches (the more, the better). Make sure you create watches of different types (advanced/json or threshold), watches with or without names, etc. There are different watches and use cases described in the [documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher). Also, adding sample data sets is helpful so that you can get watches to execute and have values under the "Condition last met" and "Last checked" columns. 3. After creating various watches, open the table with watches and make sure that all functionalities work correctly. For example: - All watches are displayed, check with >10 watches and different page sizes. - Sorting works for all columns. - Search bar works as expected and searching by partial id is supported. - Deleting watches updates the table correctly. https://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80 ## Release notes: This update resolves multiple issues in Watcher UI that were introduced in 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying more than 10 watches, an error banner appearing unexpectedly in certain scenarios, and the search bar functionality not working as expected. (cherry picked from commit 5c0b6b0)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jun 16, 2025
Fixes elastic#221820 Fixes elastic#220879 ## Summary This PR reverts elastic#204296 and elastic#218853 as these PRs caused issues in the UI due to limitations in the Query Watches API. Therefore, we are temporarily reverting back to fetching watches through the `.watches` system index until we have better support from the Query Watches API. **How to test:** 1. Start Es with `yarn es snapshot --license=trial` and Kibana with `yarn start` (no need to test in serverless as Watcher is not available there. 2. Navigate to Stack Management -> Watcher and create multiple watches (the more, the better). Make sure you create watches of different types (advanced/json or threshold), watches with or without names, etc. There are different watches and use cases described in the [documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher). Also, adding sample data sets is helpful so that you can get watches to execute and have values under the "Condition last met" and "Last checked" columns. 3. After creating various watches, open the table with watches and make sure that all functionalities work correctly. For example: - All watches are displayed, check with >10 watches and different page sizes. - Sorting works for all columns. - Search bar works as expected and searching by partial id is supported. - Deleting watches updates the table correctly. https://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80 ## Release notes: This update resolves multiple issues in Watcher UI that were introduced in 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying more than 10 watches, an error banner appearing unexpectedly in certain scenarios, and the search bar functionality not working as expected. (cherry picked from commit 5c0b6b0)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jun 16, 2025
Fixes elastic#221820 Fixes elastic#220879 ## Summary This PR reverts elastic#204296 and elastic#218853 as these PRs caused issues in the UI due to limitations in the Query Watches API. Therefore, we are temporarily reverting back to fetching watches through the `.watches` system index until we have better support from the Query Watches API. **How to test:** 1. Start Es with `yarn es snapshot --license=trial` and Kibana with `yarn start` (no need to test in serverless as Watcher is not available there. 2. Navigate to Stack Management -> Watcher and create multiple watches (the more, the better). Make sure you create watches of different types (advanced/json or threshold), watches with or without names, etc. There are different watches and use cases described in the [documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher). Also, adding sample data sets is helpful so that you can get watches to execute and have values under the "Condition last met" and "Last checked" columns. 3. After creating various watches, open the table with watches and make sure that all functionalities work correctly. For example: - All watches are displayed, check with >10 watches and different page sizes. - Sorting works for all columns. - Search bar works as expected and searching by partial id is supported. - Deleting watches updates the table correctly. https://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80 ## Release notes: This update resolves multiple issues in Watcher UI that were introduced in 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying more than 10 watches, an error banner appearing unexpectedly in certain scenarios, and the search bar functionality not working as expected. (cherry picked from commit 5c0b6b0)
kibanamachine
added a commit
that referenced
this pull request
Jun 16, 2025
…224080) # Backport This will backport the following commits from `main` to `9.0`: - [[Watcher] Revert back to using .watches system index (#223898)](#223898) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-16T14:26:24Z","message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Watcher","Team:Kibana Management","backport:version","v9.1.0","v8.19.0","v9.0.3","v8.18.3"],"title":"[Watcher] Revert back to using .watches system index","number":223898,"url":"https://github.com/elastic/kibana/pull/223898","mergeCommit":{"message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223898","number":223898,"mergeCommit":{"message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Jun 16, 2025
…#224079) # Backport This will backport the following commits from `main` to `8.19`: - [[Watcher] Revert back to using .watches system index (#223898)](#223898) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-16T14:26:24Z","message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Watcher","Team:Kibana Management","backport:version","v9.1.0","v8.19.0","v9.0.3","v8.18.3"],"title":"[Watcher] Revert back to using .watches system index","number":223898,"url":"https://github.com/elastic/kibana/pull/223898","mergeCommit":{"message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223898","number":223898,"mergeCommit":{"message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Jun 16, 2025
…#224078) # Backport This will backport the following commits from `main` to `8.18`: - [[Watcher] Revert back to using .watches system index (#223898)](#223898) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-16T14:26:24Z","message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Watcher","Team:Kibana Management","backport:version","v9.1.0","v8.19.0","v9.0.3","v8.18.3"],"title":"[Watcher] Revert back to using .watches system index","number":223898,"url":"https://github.com/elastic/kibana/pull/223898","mergeCommit":{"message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223898","number":223898,"mergeCommit":{"message":"[Watcher] Revert back to using .watches system index (#223898)\n\nFixes https://github.com/elastic/kibana/issues/221820\nFixes https://github.com/elastic/kibana/issues/220879\n\n## Summary\n\nThis PR reverts #204296 and\nhttps://github.com//pull/218853 as these PRs caused issues\nin the UI due to limitations in the Query Watches API. Therefore, we are\ntemporarily reverting back to fetching watches through the `.watches`\nsystem index until we have better support from the Query Watches API.\n\n**How to test:**\n1. Start Es with `yarn es snapshot --license=trial` and Kibana with\n`yarn start` (no need to test in serverless as Watcher is not available\nthere.\n2. Navigate to Stack Management -> Watcher and create multiple watches\n(the more, the better). Make sure you create watches of different types\n(advanced/json or threshold), watches with or without names, etc. There\nare different watches and use cases described in the\n[documentation](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher).\nAlso, adding sample data sets is helpful so that you can get watches to\nexecute and have values under the \"Condition last met\" and \"Last\nchecked\" columns.\n3. After creating various watches, open the table with watches and make\nsure that all functionalities work correctly. For example:\n- All watches are displayed, check with >10 watches and different page\nsizes.\n- Sorting works for all columns.\n- Search bar works as expected and searching by partial id is supported.\n- Deleting watches updates the table correctly.\n\n\nhttps://github.com/user-attachments/assets/d0da9c24-7389-481d-8a16-a0d01bda0e80\n\n## Release notes:\nThis update resolves multiple issues in Watcher UI that were introduced\nin 8.18.0, 8.18.1, 9.0.0, and 9.1.0, including the table not displaying\nmore than 10 watches, an error banner appearing unexpectedly in certain\nscenarios, and the search bar functionality not working as expected.","sha":"5c0b6b0fe7c08b20a6cc540b0e90b8106147b54a"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #218341
Summary
This PR fixes the watches table where only up to 10 watches were previously displayed because the Query Watch API returns maximum 10 watches by default. To fix this and to avoid performance issues for clusters with a large number of watches, we use pagination to only fetch the watches for the current page.
Limitations:
_idandmetadata.*fields. However, we cannot allow sorting by ID in the table because this requires enabling theindices.id_field_data.enabledcluster setting, which is disabled by default in the cluster. We can only sort by Name because the name is part of themetadataproperty. Therefore, we need to remove sorting for all columns but the Name._idandmetadata.*fields can be searched. Additionally, for_idwe cannot use a wildcard query so the user would need to input the whole id for the requested watch to be displayed. For name, we can use a wildcard query so searching by a substring of a name should work.How to test:
Screen.Recording.2025-04-24.at.16.09.29.mov