My grafana "success rate alert" returns value of -1 when re-fired probably because when the re-fire happens there is no data.
I've configured the alerting policy to be "Keep Last State" if no data , however this keeps only the state, not the value. (note* I want the alert not to auto-resolve unless success rate >90% is reached)
Is there a way to show the initial alert success rate on alert re-firing instead of -1 ?
PromQL query:
(
(
sum by (uri, method) (
increase(http_client_requests_milliseconds_count{
system_name="system-1",
deployment_environment="dev",
service_name="service-1",
outcome="SUCCESS"
}[15m]) or vector (0)
)
)
/
(
sum by (uri, method) (
increase(http_client_requests_milliseconds_count{
system_name="system-1",
deployment_environment="dev",
service_name="service-1"
}[15m]) or vector (0)
) > 0
)
) * 100
Alert rule Math: ($A >= 0) * ($A <= 90)