I am drawing a graph in grafana where I am getting the rate of one counter and subtracting it from rate of another counter. I am using the Interval Variable in the graph. Now when I want to use 5m as interval, I want the rate to be multiplied (5*60). Similarly when 1h then it should be multiplied by (1 * 24 * 60 * 60)
$period = 1m,5m,10m,1h and like this.
My query
rate(service_total{state="otp_send"}[$period]) * 300 - ignoring(state) rate(service_total{state="otp_validate"}[$period]) *300
So I want this 300 to be put in a variable which changes when I change the $period value in grafana
> If $period is 5m, 300 should be 300
> If $period is 1m, 300 should be 60
> If $period is 10m, 300 should be 600
And in this way. Is there something that I can do in grafana.
SO basically I want to attach the $period to a constant variable that multiplies according to the interval.