Mathematical operations with Summary

23 views
Skip to first unread message

Stanislav Panov

unread,
Apr 2, 2020, 12:22:29 PM4/2/20
to Prometheus Users
Hello!

Can you help me?

I have a summary metric
http_server_requests_seconds{instance="", quantile="", uri=""}
http_server_requests_seconds_count{instance="", uri=""}
http_server_requests_seconds_sum{instance="", uri=""}

and I'm trying to figure out how to calculate the 95 quantile across all instances.
I know that there is no way to aggregate the quantile of Summary, but I want to try to implement the formula:

(quantile95_instance_1 * count_instance_1 + ... + quantile95_instance_N * count_instance_N ) / (count_instance_1 + ... + count_instance_N)

However, when I multiply http_server_requests_seconds * http_server_requests_seconds_count, there is no data in the response

Do I understand correctly that:
1. In the Summary type, mathematical operations can only be applied to the _sum and _count metrics?
2. This is because the _sum and _count metrics are consistent in time with each other, while the metric with quantile is not?

3. And if point 1 is correct, is it possible mathematically or in some other way for this metric to calculate the 95 quantile across all instances.


Reply all
Reply to author
Forward
0 new messages