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
query service "search" api 'limit', 'total' and 'offset' fields are not supplied on response #2027
Comments
Thet are not supported by the backend, and pagination is also not supported. There's no benefit in returning them in the current state. |
This really makes the API difficult to use. So there is not way to order the search results, and there is no way to use pagination? In effect, you need to query down to eg. second long time intervals if you need to make sure that you pick up all results in an even moderately loaded system. |
Do you want to give it a try? A first step would probably be to create an interface that defines the pagination functions, and make at least one storage plugin to implement it. The Query handler can then check if the current storage plugin implements the interface and will call the appropriate functions to get paginated results. |
@jpkrohling: I was going through this issue and tried a few approaches. As I understand the approach you mentioned, is it correct to say that the querying method of the storage layer would remain the same? The storage implementation would get the results like it does now and then a pagination function is called to return a paginated response. Is this correct? I think getting pagination done on the storage query might help the performance, and looks straightforward to implement. Thanks |
|
@yurishkuro Let me know if my understanding is correct. I would like to implement it. |
@pranoyk the blob you linked also clearly explain why you SHOULD NOT implement offset-based pagination. We have no specific requirement to implement pagination exactly as page-number access |
@yurishkuro Alright! In that case, should we go ahead with cursor-based pagination? If so, I can start looking at the implementation since as you mentioned our storage data is not organized to allow pagination. |
feel free to give it a try |
From what I understand, in ES mapping we have spanID which would be unique, or traceID which can be used as a cursor(need your input on which field would be more suitable) and sort it based on startTime. PS. Currently, I am planning only for ES. Once this is done, I will have a look at Cassandra. |
@yurishkuro should I go ahead and give the above a shot? I will have to create a new interface that would do the pagination and then use it. If this is not required I will look into some other issue. Thanks! |
Please explain the approach you want to take. |
We would have to implement scroll search in elastic search.
All of these are 3 different APIs and hence we would require separate methods. Our api/traces must be able to tell us whether the request is the first request or subsequent page request else we might have to keep track of it somehow (not sure we are already doing something like this) We also need to make a note that if there are new traces after a scrollID is been created then we won't be able to access them. In such cases we would have to first clear the scroll and then recreate it. |
|
I went through the other storage backends we use and we can abstract out the above solution for all of them. We need our api/traces to tell us whether it's the first request or the subsequent one.
Also, one open question is how to move backward on the page. Right now, it looks like there are very different approaches for our storage backend. I will have to look more into it in order to abstract it. |
It would be useful when you throw in backend-specific terms like "Page State" if you included links to the documentation. I am still quite skeptical about any built-in pagination APIs because the tracing data and the way we write it does land itself to stable ordering. The best approximation of a token would be the timestamp, such that the next page (as in "more" not "page #X") would be a query with
Here, after you execute the first query, more spans can be stored with later ts, but smaller duration (still in the range). So unless the storage somehow materializes the query and natively supports "next page" operation, it's difficult to support it.
If there were some more or less common abstraction, for example returning some opaque blob of "current page token" that is specific to the backend, it would provide a unified API for the UI to use. |
I got your point. I will have to check how we can create some wrapper to paginate rather than using the inbuilt pagination and compare between using the inbuilt pagination APIs. |
Requirement - what kind of business use case are you trying to solve?
set of fields are not supplied on the query service search response
Service: jaeger query
API:
/apt/traces
Current response:
Response struct:
jaeger/cmd/query/app/http_handler.go
Line 56 in 886b965
Response part:
jaeger/cmd/query/app/http_handler.go
Line 238 in 886b965
Fields
total
,limit
andoffset
are not supplied on the response part.I am ready yo submit a PR if someone guide me to get these fields.
The text was updated successfully, but these errors were encountered: