This commit adds functionality to the global-query server: it provides an SSE (server-sent-events) endpoint for querying, which pushes partial results back to the client whenever a new result has been received by the distributed querier.
The premise of this change is that, for long-running queries involving many hosts, the user already gets feedback on progress.
Client
goQuery now has a flag --query.streaming which uses an SSE client capable of parsing the event stream provided by global-query's SSE endpoint. This client supports two callback functions:
onUpdate: for every partial result
onFinish: for when the final (last) result is received in the stream
to communicate progress. So far, these functions are hard-coded in root.go and don't do much beyond logging. They may be extended in the future.
Background
This commit adds functionality to the global-query server: it provides an SSE (server-sent-events) endpoint for querying, which pushes partial results back to the client whenever a new result has been received by the distributed querier.
The premise of this change is that, for long-running queries involving many hosts, the user already gets feedback on progress.
Client
goQuery
now has a flag--query.streaming
which uses an SSE client capable of parsing the event stream provided by global-query's SSE endpoint. This client supports two callback functions:onUpdate
: for every partial resultonFinish
: for when the final (last) result is received in the streamto communicate progress. So far, these functions are hard-coded in
root.go
and don't do much beyond logging. They may be extended in the future.