title: Can I create an alert in Prometheus when a value is outside of an range of previous values?
body: <p>I want to monitor spring batches. To do that I have set up metrics in the source code and send them via a PushGateway to Prometheus. In Prometheus I want to set an alerting rule if the current value is outside of the interquartile range of that metric.</p>
  <p>My metric for example <code>batch_records</code> that counts the amount of records that this batch is processing. To check now if the batch is doing nicely I want to compare the amount of records with the amount of records with the previous runs. For that I choose the interquartile range and if a value is outside the range I want to throw an alert.</p>
  <p>I have found the <code>quantile</code> function in PromQL but I don't now how to compare the current amount of records with the amount of records from all previous runs.</p>