How to prepare a proper SLA query in Elasticsearch


Currently I am using ELK + Grafana stack and I am supplying it with data from JMeter. Jmeter is responsible for testing web service and asserting the responses - which later on are being pushed to my ELKG stack.

I have created a simple SLA query, which counts all occurences of a particular log, then counts how many of them does have ErrorCount:1 (assertion made in JMeter) and finally I am using a simple math formula to calculate the percentage of SLA:

((all_occurences - errors) * 100 ) / all_occurences

Is it possible to create a query which will count a downtime towards SLA only if.. lets say 10 last occurences of particular element has failed? In other words - I would like to lower the total SLA value only if error has occured 10 times in a row.

It would be the best if I could use the solution directly in Grafana query bar, but I would be happy with anything else.

I have failed miserably trying to find similar issues and I feel helpless at this point. I would be very grateful for any help, keywords, links that could help me achieve my goal.

Thanks in advance for any help!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.