Skip to content
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

Histogram over percentiles #284

Open
vkaverin opened this issue Feb 21, 2023 · 4 comments
Open

Histogram over percentiles #284

vkaverin opened this issue Feb 21, 2023 · 4 comments
Labels
A-api Area: statshouse-api A-prom Area: Prometheus / OpenMetrics / PromQL compatibility A-ui Area: statshouse-ui C-feature-request Category: request for new functionality

Comments

@vkaverin
Copy link

vkaverin commented Feb 21, 2023

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].

@vkaverin
Copy link
Author

vkaverin commented Feb 21, 2023

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.

@flyingmutant
Copy link
Contributor

flyingmutant commented Feb 21, 2023

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

@flyingmutant flyingmutant added A-ui Area: statshouse-ui A-api Area: statshouse-api C-feature-request Category: request for new functionality labels Feb 21, 2023
@vkaverin
Copy link
Author

vkaverin commented Feb 21, 2023

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.

@flyingmutant
Copy link
Contributor

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.

@flyingmutant flyingmutant added the A-prom Area: Prometheus / OpenMetrics / PromQL compatibility label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: statshouse-api A-prom Area: Prometheus / OpenMetrics / PromQL compatibility A-ui Area: statshouse-ui C-feature-request Category: request for new functionality
Projects
None yet
Development

No branches or pull requests

2 participants