I am trying to create a graph showing stacked percentage distribution over time for one metric with tags. The metric is counter with different tags. Example:
fruits_total{fruit=["apple","banana",...]
I am trying to visualise the distribution over time in percentage for fruits, compared to total count.
I tried this query(not working):
100*(sum(rate(fruits_total)[1m]) by (fruit)) / sum(rate(fruits_total)[1m])
I found a way to do the query! https://promlabs.com/products
For the example it will looks like:
100*(sum by (fruit) (rate(fruits_total)[1m]) / on() group_left sum(rate(fruits_total)[1m])