I have a calculated service metric that track a key request count with a processing time of >10 seconds.
I want to use this metric in a SLO to track how many of the total key request are within a timeout limit set in an application.
The problem occur when no requests have a processing time of > 10 seconds, and the metrics return “no data” which in return causes my SLO to fail instead of showcasing 100%.
Obviously the metric expression can not use null or zero in the definition, so I was wondering if there is another way to get the result om looking for?
When calc:service.custom-metric-bad-request-count have data, the metric express produces the SLO output I’m looking for, but when calc:service.custom-metric-bad-request-count dont have any data the SLO fail.
Thank you so much for taking the time to provide an answer.
I tried adding :defualt(0) to my calculated metric that lack data, but it does not work. I can then add :defualt(0,always) like suggested in this thread on the same topic, but the math does not add up.
I can isolate the individual metrics, and get a confirmation on the data, but when I set up the expression for calculation, the result does not match.
I can setup calc:service.custom-metric-bad-request-count":splitBy():default(0, always) by itself and display zero, but when I try to setup the expression the output is wrong.
An example with values could be ((200-0)/(200))*100
Red = Calculated metric with no data and the addition of :default(0, always)
Green = Total count
Obivously this should output 100, but it does not. It output a number that is nowhere close.
I have the same problem, I need to bring a calculated metric of no response (another item that is not included) and when I try to remove the SLO, it breaks the entire expression.
@rsmsdk@fpereira22
Because of having a calculated, or just because of having different metrics, it must be applying a different aggregation from the intended…
Apply a Fold transformation. For instance: