'prometheus alert expression for 99% availability of rest API

I would like to create an alert in Prometheus for a REST API, if the API is not available 99% of the time. I am new to prometheus expression. Could you please help me to create an expression to trigger this ALERT. For example if i have a counter failed_counter that tracks the http failures. Please help.



Solution 1:[1]

  1. Assuming that you are looking to implement a SLO strategy: Please, read this post

implementing-slos-using-prometheus

You can use the following tool for that: SLO generator.

promtools SLOs

This website could be helpful as well:

awesome-prometheus-alerts

  1. You can combine with black-box exporter

blackbox_exporter

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 erasmolpa