# How to disable alerts on no data in Metric Threshold rule

**URL:** https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751
**Category:** Elastic Observability
**Tags:** elastic-stack-alerting
**Created:** [October 4, 2022, 8:38am UTC](https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751 "2022-10-04T08:38:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![woodywoodsta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woodywoodsta/32/107962_2.png) [@woodywoodsta](https://discuss.elastic.co/u/woodywoodsta)
#### Post date: [October 4, 2022, 8:38am UTC](https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751/1 "2022-10-04T08:38:57Z")

</div>

Hey.

I've set up a Metric Threshold alert on some fairly infrequent metric data (which actually comes from the Kubernetes Elastic Agent integration). The filter on the metric data is:

```nohighlight
host.name:host* AND event.dataset: kubernetes.event AND kubernetes.event.type: Warning

```

The condition is:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/8/185cc363f19da98c5fb681b7dc8e92582df77044.png)

and the grouping is:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/9/49c754dc56b8c6ff9a5aac5d209458faf83aec82.png)

However, I'm getting alerts for no data even though this makes no sense given I'm only interested in a document count \>= 1. I also see that the checkboxes for enabling alerts on no data are greyed out, but checked. Why can these not be disabled?

Otherwise, this kind of alert is useless.

The natural language use case statement is: _I want to be alerted if there is 1 or more Kubernetes warnings within the period of 10 min._

---

<div class="post-metadata">

### Author: ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)
#### Post date: [October 4, 2022, 12:08pm UTC](https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751/2 "2022-10-04T12:08:11Z")

</div>

Hi @woodywoodsta,

the change that conditionally disables the checkbox was added in [[Metrics UI] DIsable No Data checkboxes for doc count alerts by Zacqary · Pull Request #117194 · elastic/kibana · GitHub](https://github.com/elastic/kibana/pull/117194). Is it possible that you created the alert on an older version of Kibana and upgraded to a newer one since?

If so, I see two way that you could get rid of that enabled checkbox:

1. Temporarily add a condition that is not based on a "document count" metric. This should re-enable the checkbox so you can uncheck it. Afterwards you can remove the temporary condition again.
2. Re-create a new identical alert but without the box checked from the beginning.

Let us know if that works for you.

---

<div class="post-metadata">

### Author: ![woodywoodsta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woodywoodsta/32/107962_2.png) [@woodywoodsta](https://discuss.elastic.co/u/woodywoodsta)
#### Post date: [October 4, 2022, 12:33pm UTC](https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751/3 "2022-10-04T12:33:30Z")

</div>

Hey @weltenwort. It's very possible that I was experimenting with other types of conditions in the same rule. I'll try what you have suggested and report back, thank you!

---

<div class="post-metadata">

### Author: ![woodywoodsta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woodywoodsta/32/107962_2.png) [@woodywoodsta](https://discuss.elastic.co/u/woodywoodsta)
#### Post date: [October 4, 2022, 12:39pm UTC](https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751/4 "2022-10-04T12:39:29Z")

</div>

@weltenwort Temporarily changing the condition to enable the checkbox, uncheck and change the condition back to doc count worked correctly, thank you.

This seems like a bug to me, and I've actually already made a comment on that old PR asking about why this checkbox was disabled, since clearly it still "works" and is relevant in some use cases (albeit redundant). If we think it's a bug, I can open a new issue on the repo if needed.

---

<div class="post-metadata">

### Author: ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)
#### Post date: [October 4, 2022, 2:05pm UTC](https://discuss.elastic.co/t/how-to-disable-alerts-on-no-data-in-metric-threshold-rule/315751/5 "2022-10-04T14:05:46Z")

</div>

Glad to hear it worked. I'm personally not sure why it was disabled for "document count" conditions, but I think it should at least be possible to toggle it off regardless. That part definitely feels like a UX bug.
