# Alert flapping every specified interval

**URL:** <https://community.grafana.com/t/alert-flapping-every-specified-interval/8245>\
**Category:** Alerting\
**Tags:** alerting\
**Created:** [June 22, 2018, 1:25pm UTC](https://community.grafana.com/t/alert-flapping-every-specified-interval/8245 "2018-06-22T13:25:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaumann](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jaumann/32/4111_2.png) [@jaumann](https://community.grafana.com/u/jaumann)\
**Post date:** [June 22, 2018, 1:25pm UTC](https://community.grafana.com/t/alert-flapping-every-specified-interval/8245/1 "2018-06-22T13:25:04Z")

</div>

Hi! I created an alert for my prometheus data that is flapping every 30 seconds, which is the specified interval I set to check. I’m trying to check if the desired number of pods doesn’t equal the number of available pods in my k8s cluster for an entire 15 minute period. The alert appears to be stating that the metric I specified is the value it was when it last alerted, but if I click “test alert”, the json returned specifies that there shouldn’t be an alert right now. I’m not sure why this is flapping, and any insight would be greatly appreciated. Here’s the relevant info:

Alert Query:` (sum(kube_deployment_spec_replicas{namespace="default"}) without (deployment, instance, pod)) - (sum(kube_deployment_status_replicas_available{namespace="default"}) without (deployment, instance, pod))`  
Condtion: `WHEN min() OF query(G,15m,now) IS ABOVE 0.5`  
If no data or all values are null set state to Ok  
If execution error or timeout set state to keep last state
