[prometheus, grafana] count, sum, bucket

hi guys

I need to calculate latency duration of grpc request in grafana from data in prometheus - but bucket is missing:
sum(rate(k6_grpc_req_duration_bucket{name="${K6RequestName}"}[$__rate_interval])) by (le)

a similar situation is with mean latency - sum and count are missing:
1000*sum (rate(k6_grpc_req_duration_sum{name="${K6RequestName}"}[$__rate_interval]))/sum (rate(k6_grpc_req_duration_count{name="${K6RequestName}"}[$__rate_interval]))

maybe there is another way to calculate these params using already existent metrics?

Hi @kostiamol,
I expect you’re using the xk6 Prometheus Remote output, you can read more about the data mapping and future plans between k6 and Prometheus output in this article: Combine k6 OSS and Prometheus for better observability.

gRPC duration metric in k6 is a Trend type and as the article shows is mapped with six gauges.

Let me know if it helps.

Hi @codebien,
Yep, I use this extension and I read the article. But the available 6 gauges (min, max, avg, med, p90, p95) are not sufficient for my use case.

But how to calculate mean latency and latency duration of grpc reqs using existent means?