mimir icon indicating copy to clipboard operation
mimir copied to clipboard

Store-gateway: add streaming support to LabelValues() API

Open pracucci opened this issue 3 years ago • 1 comments

Similarly to https://github.com/grafana/mimir/issues/3348 we should add streaming support to LabelValues() API.

What's the priority between LabelValues() and LabelNames()?

I think making LabelValues() streaming based is higher priority than LabelNames(). A look at some Mimir clusters at Grafana Labs, I can see LabelValues() has an higher req/s rate and latency.

Req/s in some clusters over the last 7d:

Screenshot 2022-12-16 at 14 57 10

99th latency (sec) in some clusters over the last 7d:

Screenshot 2022-12-16 at 14 57 55

pracucci avatar Dec 16 '22 13:12 pracucci

Discussing more internally at Grafana Labs, there may be not much value rewriting LabelValues() in a streaming way, unless we find some real requests taking GBs of memory. Typically these requests allocates order of magnitude less memory than Series() (for which we already support the streaming-based version).

pracucci avatar Jan 25 '23 10:01 pracucci

Anecdotally, I've seen memory usage spikes coinciding with LabelValues calls. But until Also https://github.com/grafana/mimir/issues/4595 was merged last week we didn't have much visibility into resource usage during LabelValues calls.

There is also #4593 which may help here.

dimitarvdimitrov avatar Apr 17 '23 08:04 dimitarvdimitrov