06 May 2026 04:14 PM
Hello,
I'd like to calculate a ratio between totalCalls and successCalls using a metric "log.prgoffer.foapi.baminfo.golden.exceptions".
timeseries totalCalls=sum(log.prgoffer.foapi.baminfo.golden.exceptions),
interval:
duration(toLong(substring($Interval,from:0,to:stringLength($Interval)-1)),
unit:getCharacter($Interval,stringLength($Interval)-1))
and
timeseries successCalls=sum(log.prgoffer.foapi.baminfo.golden.exceptions),
filter: {
matchesValue(baminfo.exception, "OK")
},
interval:
duration(toLong(substring($Interval,from:0,to:stringLength($Interval)-1)),
unit:getCharacter($Interval,stringLength($Interval)-1))
Solved! Go to Solution.
06 May 2026 05:30 PM
Hello @enrico_afkl!
You can try this one:
timeseries {
totalCalls = sum(log.prgoffer.foapi.baminfo.golden.exceptions),
successCalls = sum(
log.prgoffer.foapi.baminfo.golden.exceptions,
filter: matchesValue(baminfo.exception, "OK")
)
},
interval: duration(
toLong(substring($Interval, from: 0, to: stringLength($Interval) - 1)),
unit: getCharacter($Interval, stringLength($Interval) - 1)
)
| fieldsAdd
successRatio = successCalls[] / totalCalls[] * 100
I hope it helps 😀
07 May 2026 07:46 AM
that's perfect thanks!
Featured Posts