If I want to get the ratio between two time series to compute a success or error percent (e.g. compute an AWS ELB 5xx vs. 2xx ratio), is that an expected use case? I think I would have expected a function to do that to keep the syntax concise and to avoid having to manually handle divide by zero, so just want to make sure I'm going down the right path.
e.g. so something like this would be expected in these cases?
ts("myapp.error")/ts("myapp.success")
thanks!
A fairly common pattern in these cases would be to divide the number of errors by the total number of requests - in this case your ratio is more accurate and you don't have to worry about division by zero:
ts("myapp.httpstatus.5*") / sum(ts("myapp.httpstatus.*"))
If your metrics are cumulative counters, a rate() function can be used to calculate the rate of change:
rate(ts("myapp.httpstatus.5*")) / sum(rate(ts("myapp.httpstatus.*")))
Please let us know if this helps!
-Vasily
A fairly common pattern in these cases would be to divide the number of errors by the total number of requests - in this case your ratio is more accurate and you don't have to worry about division by zero:
ts("myapp.httpstatus.5*") / sum(ts("myapp.httpstatus.*"))
If your metrics are cumulative counters, a rate() function can be used to calculate the rate of change:
rate(ts("myapp.httpstatus.5*")) / sum(rate(ts("myapp.httpstatus.*")))
Please let us know if this helps!
-Vasily
perfect, thanks!