-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Kibana should avoid using .watches index directly #152142
Comments
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
@ElenaStoeva can you look into the level of effort to address this one? |
It seems that the Watcher fetches watches by sending a search request on the
After this, some additional changes are needed to process the response as the Json fields in this response are slightly different from what is returned from the search request to the .watches index. What concerns me is the part where Watcher fetches a history item by its id. Here, it sends a search request to the |
Thanks @ElenaStoeva for looking into this.
👍 let's move forward with this change.
Yes, good point. I don't think we'll be able to replace this with the current set of ES APIs. Can you open up a separate issue to track this? @masseyke any guidance on this would be appreciated. |
I'm sorry I completely missed the questions on this. We don't currently have an API that reads from the |
The |
After a discussion with @ElenaStoeva, we thought that using the Query Watch API for pagination would be a performance improvement, instead of loading all existing watches into the browser. That is currently not possible because the Query Watch API filters and sorts only by the watch id. @masseyke Do you think it would be possible to add more watch properties like state, when it last met condition etc to filtering and sorting? |
Pinging @elastic/kibana-management (Team:Kibana Management) |
@sabarasaba / @alisonelizabeth Hi folks! I have been tasked to look into this from the Watcher side. Looking at and testing locally the Query Watches API, it does seem that it provides the required functions (Filter, sort, page etc) however it seems the limiting factor is that the underlying I think the way forward here is if you could get us a list of the fields in |
Hey @lukewhiting, sorry for the delay its been a busy week! Currently sorting and filtering happen on client side. But if the api would support that we could leverage it, currently we allow users to
|
@sabarasaba Fantastic :-) Thanks for that info. I'll get to work making the required mapping changes for those fields. |
@sabarasaba I'm afraid we have hit a bit of a speed bump. We can deliver all the requested sort and filter fields requested with the exception of Talking to the Search Foundations team, there is deliberately no work around to this due to known performance issues when sorting by How would you like to proceed? Would you like us to continue delivering the other sorts and filters or would you prefer to continue with client side filtering and sorting but using the new API endpoint? |
I think at the least we can make changes so that we start indexing the name of the watch for newly created |
Yep that's definitely an option but the client side logic for that may be rather complex? For an upgraded cluster you end up with a mix of some docs that have the new field and some that don't in the Happy to implement that change but would like to check in with the Kibana team to make sure it's worth it for them. |
## Summary Simply uses the ES Watcher API to load watches instead of a search query against the `.watches` index. This appears to be the last direct query against that index. Part of #152142
## Summary Simply uses the ES Watcher API to load watches instead of a search query against the `.watches` index. This appears to be the last direct query against that index. Part of elastic#152142 (cherry picked from commit bc5c097)
## Summary Simply uses the ES Watcher API to load watches instead of a search query against the `.watches` index. This appears to be the last direct query against that index. Part of elastic#152142
@sabarasaba (and possibly @mattkime as you seem to be working on this?) Could I get your opinion this this comment please: #152142 (comment) Would you like us to go ahead with implementing server side sort (Given the limitations and split results) or would you prefer to continue client side sorting just with the new API? |
@lukewhiting Hey sorry for the delay, I've been on paternal leave for a while and just now came back. Let me chat with the team today about it and I'll get back to you. |
We will try to get some telemetry on the average number of watches customers have in order to determine if we want to pursue a client side or server side implementation, we'll keep you posted |
@sabarasaba See if you can use this dashboard for watcher telemetry |
## Summary Simply uses the ES Watcher API to load watches instead of a search query against the `.watches` index. This appears to be the last direct query against that index. Part of elastic#152142
If nobody objects, i'm going to close this issue as the required work for 9.0 and the original scope of this ticket is done. I have raised a feature request on the Elasticsearch side for server side sorting and will update the team as and when that's implemented. |
In Elasticsearch 8.0, direct access to system indices was intentionally made much more difficult by Elasticsearch. Kibana uses system indices (
.watches
and.watcher_history
) for the "Watcher" part of Stack Management. It looks like it makes a request to_security/user/has_privileges
for the .watches and .watcher_history system indices, and only shows the Watcher link if the user has read access to them. And then it does a search request directly on the .watches index. The problem is that, due to the changes in Elasticsearch in 8.0, users have to add that read privilege to their role using the "allow_restricted_indices" flag like this:But I don't think that Kibana will let you use that flag (I could be wrong).
I think this can now be done without accessing system indices at all. There is now an API for fetching all watches (elastic/elasticsearch#64582) that does not require permission to read any system indices directly. If it can't be done without direct access to those indices then the @elastic/es-data-management team probably needs to add whatever is missing.
The text was updated successfully, but these errors were encountered: