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

EQL _async_search status API #66955

Closed
lizozom opened this issue Jan 4, 2021 · 10 comments · Fixed by #68065
Closed

EQL _async_search status API #66955

lizozom opened this issue Jan 4, 2021 · 10 comments · Fixed by #68065
Assignees
Labels
:Analytics/EQL EQL querying >enhancement :Search/Search Search-related issues that do not fall into other categories Team:QL (Deprecated) Meta label for query languages team Team:Search Meta label for search team

Comments

@lizozom
Copy link

lizozom commented Jan 4, 2021

We need an API similar to the one implemented for the KQL async search #57537 to check the status of running EQL requests.

The request and response formats should be identical.

@lizozom lizozom added >enhancement needs:triage Requires assignment of a team area label labels Jan 4, 2021
@mayya-sharipova mayya-sharipova added :Search/Search Search-related issues that do not fall into other categories and removed needs:triage Requires assignment of a team area label labels Jan 4, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jan 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@mayya-sharipova mayya-sharipova added the :Analytics/EQL EQL querying label Jan 4, 2021
@elasticmachine elasticmachine added the Team:QL (Deprecated) Meta label for query languages team label Jan 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Jan 12, 2021

There are several ways we can organize an API for the status of EQL search:

  1. Use the same API as for non EQL searches:
GET /_async_search/status/<ID>
  1. Use the EQL specific API
GET /_eql/search/status/<ID>

@lizozom @jimczi What do you think of each option?
I personally favour 2nd option, as EQL can also store the synchronous requests with keep_on_completion parameter, whose status can be checked, thus using _async_search wording in the status API seems incorrect.

@lizozom Is it important for you to have a single API to check the status regardless whether it is EQL search or not? Or is it important for you to differentiate between EQL searches and other searches?

@lizozom
Copy link
Author

lizozom commented Jan 13, 2021

@mayya-sharipova I have a preference for a single API.
In the context of checking the status - the strategy used to run them doesn't seem to matter, and it would require additional effort to support this in KIbana.
It would be even more important as we move towards having a bulk status API.

@mayya-sharipova
Copy link
Contributor

Thanks @lizozom.
For the unified status API for searches, @jimczi what do you think of these options?

GET _searches_status/<ID>

or

GET _stored_searches_status/<ID>

@jimczi
Copy link
Contributor

jimczi commented Jan 13, 2021

I am a bit on the fence because that would mean that we need to differentiate EQL from async_search simply looking at the ID. I can see why it would be useful to have a single API but I am afraid that it complicates things going forward since async searches and EQL behave differently. @lizozom is it really challenging to make the distinction in Kibana ? I guess it would be easier to access this infos in the Kibana Search Sessions than tweaking the ID when we create it.

@lizozom
Copy link
Author

lizozom commented Jan 18, 2021

@mayya-sharipova after talking to @jimczi, it's fine to have two separate APIs with identical req\res formats.
(And if and when we decide to have a bulk API, we'd pass in the async ids with a type, so that you could work with them more easily)

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Jan 18, 2021

@lizozom @jimczi Thank you, I will work on this.

So for EQL status API, the request format will be:

GET /_eql/search/status/<ID>

The response will be identical to async search status response.

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Jan 20, 2021

I've just learned that eql search response doesn't have information about shards and status. So eql status response will have a different format from async search status responses, like the following format:

{
  "id" : <id>,
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "timed_out" : false
}

I hope you are fine with this, @lizozom

@mayya-sharipova mayya-sharipova self-assigned this Jan 21, 2021
@lizozom
Copy link
Author

lizozom commented Jan 26, 2021

@mayya-sharipova this is ok, but not optimal.
This means we won't be able to have any indicator on the progress of the query.
We were planning to show some kind of progress indication using the ration between the successful and total shards.
Is there any alternative indicator we could get for EQL?

mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this issue Jan 27, 2021
Introduce eql search status API,
that reports the status of eql stored or async search.

GET _eql/search/status/<id>

The API is restricted to the monitoring_user role.

For a running eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1611690235000,
  "expiration_time_in_millis" : 1611690295000
}

For a completed eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : false,
  "is_partial" : false,
  "expiration_time_in_millis" : 1611690295000,
  "completion_status" : 200
}

Closes elastic#66955
mayya-sharipova added a commit that referenced this issue Feb 11, 2021
Introduce eql search status API,
that reports the status of eql stored or async search.

GET _eql/search/status/<id>

The API is restricted to the monitoring_user role.

For a running eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1611690235000,
  "expiration_time_in_millis" : 1611690295000
}

For a completed eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : false,
  "is_partial" : false,
  "expiration_time_in_millis" : 1611690295000,
  "completion_status" : 200
}

Closes #66955
mayya-sharipova added a commit that referenced this issue Feb 11, 2021
Introduce eql search status API,
that reports the status of eql stored or async search.

GET _eql/search/status/<id>

The API is restricted to the monitoring_user role.

For a running eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1611690235000,
  "expiration_time_in_millis" : 1611690295000
}

For a completed eql search, a response has the following format:

{
  "id" : <id>,
  "is_running" : false,
  "is_partial" : false,
  "expiration_time_in_millis" : 1611690295000,
  "completion_status" : 200
}

Backport for #68065
Closes #66955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/EQL EQL querying >enhancement :Search/Search Search-related issues that do not fall into other categories Team:QL (Deprecated) Meta label for query languages team Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants