Hi ,
I am using two query in grafana to get max and avg of “Total Slots” and “Used Slots” value. Now I need to show the avg slot % as well (Used Slots / Total Slots).

I used the meta-queries but no luck.

Hers is the o/p of my query.


I am using following Meta Query to get avg slot % (Used Slots / Total Slots)

Any idea ?

As per first data value should be 2520/3420 = 73.6 and 718/820 = 87.5

I am using Elasticsearch as a data source.


You can try Bucket script on those 2 metrics. On a single query, add 2 metrics and then add 1 more metric as Bucket script to perform the arithmetic operation.
params.var1 / params.var2

Thank you Prakul for help

I tried this but the value is not correct.


Here is my query.

PS: We are capturing Total Slots and Used Slots max value from “legend” tab.

And I need the % Slot based on this value only.