It is fairly easy to create a visualization that shows spikes in number of requests (using derivative). But how do I go about to create a watcher that triggers on a big increase in number of requests?
Ideally, we would like to trigger alerts based on a Timelion calculation. Is this supported?
Some more details:
Our application is exposing metrics in the Prometheus format, this metric is collected with metricbeat and send to Elasticsearch.
The data for a specific http endpoint looks like this:
Where 972 is the number of hits on this endpoint since the application started, this value is always increasing. We also get the total execution time and the average time for requests.
Please take the time to properly format JSON. You can use markdown in here and it eases the ability to read a post endlessly. Thanks a lot!
timelion calculation is not supported. What is the alerting condition you would like to trigger on? If the difference between two documents exceeds a certain threshold? Can you write a search that is doing this already or not? The latter question is important because if you are able to, it will be easy to write a watch.
Yes, the condition would be that the difference between two documents exceed a threshold. And I currently don't know how to write that query, is there an example online I can look at?
comparing two documents directly is hard to do in elasticsearch unless you know their direct ids.
What you could do however is run an aggregation, that filters between two time ranges (i.e. now-5m and -5m-10m), then gets the max value using a max aggregation, and the watch condition compares those two values in the condition to decide if it should be triggered.
There are few alerting examples in the examples repo, but I do not know if something matches this requirement. You should find a few examples using aggregations though in there.
So you will lose the association between each statistic and its value, making the kind of analysis you are looking for impossible.
To fix that, you have 2 options:
- Use a Nested datatype for measurements
- Use a Logstash filter to transform the data from a list of objects to nested properties (you can do this with the Ruby filter) like:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.