VKCOM/statshouse

Histogram over percentiles

vkaverin opened this issue · 4 comments

It would be nice to have a function that would tell "How many events took more time than N-th percentile?" (in case is event value is time, in this example). For 75-th percentile it would be 25% of events, but I'd like to see absolute number of events without manual calculation.

In my vision it should be a set of functions hist(P), where P in [p25, p50, p75, p90, p95, p99, p99.9].

Not sure about should it be "more than" or "less than". For p99.9 I want to see how many events were larger than p99.9. On the other hand, for p25 I would like to see how many smaller ones were there.

So for P-th percentile, (1 - P) / 100 * count? Should be quite easy to do with PromQL #111.

Basically yes, but I'd expect it to be a built-in function, instead of formula, since it looks like quite widely useful for me when percentiles are enabled for the metric, since a formula can be error-prone a little (for example, it's hard to predict whether P is in [0.0, 1.0] or [0, 100], and easy to just mess up for someone who is not good at formulas).

Is PromQL support coming soon?

If it's about to implement it manually via PromQL, will there be some space for some kind of query templates to save the formula as a template to be reused later? This would be good replacement of built-in one.

Is PromQL support coming soon?

#267 is already merged, but we haven't tested it heavily, and there is no UI support yet.

If it's about to implement it manually via PromQL, will there be some space for some kind of query templates to save the formula as a template to be reused later? This would be good replacement of built-in one.

No concrete plans about this yet, but it is an interesting idea, thanks.