# Functionality of alertOnNoData flag in Metric threshold rule \[8.10.2\]

**URL:** https://discuss.elastic.co/t/functionality-of-alertonnodata-flag-in-metric-threshold-rule-8-10-2/344530
**Category:** Metrics
**Tags:** elastic-stack-alerting
**Created:** [October 6, 2023, 10:14am UTC](https://discuss.elastic.co/t/functionality-of-alertonnodata-flag-in-metric-threshold-rule-8-10-2/344530 "2023-10-06T10:14:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![c\_rox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/c_rox/32/121884_2.png) [@c\_rox](https://discuss.elastic.co/u/c_rox)
#### Post date: [October 6, 2023, 10:14am UTC](https://discuss.elastic.co/t/functionality-of-alertonnodata-flag-in-metric-threshold-rule-8-10-2/344530/1 "2023-10-06T10:14:41Z")

</div>

I have created elastic metric threshold rule to monitor on the disk usages of each node on elastic deployments it self and enabled alertOnData so if the query returned no data or query execution had an issue I would get alerted. But,

- If add some broken filtering to query and rule is not creating alert for no data eventhoug the graph shows no data

- I removed the metrics index pattern from the Observability \> Metrics Explorer \> Settings to cut out the data completely. Still no alert but graph shows no data. I am using **.monitoring-** \* index pattern in the settings

```auto
{
  "rule_type_id": "metrics.alert.threshold",
  "name": "test_alert",
  "tags": [
  ],
  "consumer": "alerts",
  "schedule": {
    "interval": "1m"
  },
  "actions": [
    {
      "id": "action_uuid_1",
      "group": "metrics.threshold.nodata"
    }
  ],
  "params": {
    "criteria": [
      {
        "aggType": "custom",
        "comparator": ">=",
        "threshold": [
          80
        ],
        "timeSize": 5,
        "timeUnit": "m",
        "customMetrics": [
          {
            "name": "A",
            "field": "elasticsearch.node.stats.fs.summary.total.bytes",
            "aggType": "avg"
          },
          {
            "name": "B",
            "field": "elasticsearch.node.stats.fs.summary.available.bytes",
            "aggType": "avg"
          },
          {
            "name": "C",
            "field": "elasticsearch.node.stats.fs.summary.total.bytes",
            "aggType": "avg"
          }
        ],
        "equation": "((A-B)/C)*100",
        "label": "Disk Usage",
        "warningComparator": ">=",
        "warningThreshold": [
          60
        ]
      }
    ],
    "sourceId": "default",
    "alertOnNoData": true,
    "alertOnGroupDisappear": false,
    "groupBy": [
      "elasticsearch.node.name"
    ],
    "filterQueryText": "elasticsearch.node.roles : \"aaaaaaaaaaaaa\"",
    "filterQuery": "{\"bool\":{\"should\":[{\"term\":{\"elasticsearch.node.roles\":{\"value\":\"aaaaaaaaaaaaa\"}}}],\"minimum_should_match\":1}}"
  }
}

```

Just trying to understand why alertOnNoData is not working as I expected.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 3, 2023, 10:14am UTC](https://discuss.elastic.co/t/functionality-of-alertonnodata-flag-in-metric-threshold-rule-8-10-2/344530/2 "2023-11-03T10:14:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
