loki
loki copied to clipboard
Stream responses from Querier to Query Frontend.
What this PR does / why we need it: The is the result of a time boxed experiment. I wanted to see if we can stream results from the querier to the query frontend without changing the scheduler API too much.
It seems possible. However, right now the benefit is minimal. The JSON ecnoder, jsoniter, does not support stream encoding (https://github.com/json-iterator/go/issues/488). We also buffer before serialization.
Querier to query frontend streaming would enable
- Partial result streaming.
- Remote read API without buffering.
- Less buffering, i.e. fewer allocations and less memory consumption.