# Why ES doesn't have search-failure-rate metric?

**URL:** <https://discuss.elastic.co/t/why-es-doesnt-have-search-failure-rate-metric/363936>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [July 29, 2024, 2:42am UTC](https://discuss.elastic.co/t/why-es-doesnt-have-search-failure-rate-metric/363936 "2024-07-29T02:42:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ferrari248](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ferrari248/32/120904_2.png) [@Ferrari248](https://discuss.elastic.co/u/Ferrari248)\
**Post date:** [July 29, 2024, 2:42am UTC](https://discuss.elastic.co/t/why-es-doesnt-have-search-failure-rate-metric/363936/1 "2024-07-29T02:42:21Z")

</div>

Now I have a requirement: to get the real-time indexing and search statistics of `failure rate`, prefer to call ES server API.  
I have tried ES 7.X and 8.X, found that we have indexing-failure-rate metric, but doesn't have a search-failure-rate metric.  
As for indexing stats, we can use `GET /_nodes/stats?filter_path=nodes.*.indices.indexing.*` , and then got:

```auto
{
  "nodes": {
    "blAww4iBQU6UXUjMxfFrkw": {
      "indices": {
        "indexing": {
          "index_total": 16199,
          "index_time_in_millis": 7292,
          "index_current": 0,
          "index_failed": 121,
          "delete_total": 95,
          "delete_time_in_millis": 55,
          "delete_current": 0,
          "noop_update_total": 0,
          "is_throttled": false,
          "throttle_time_in_millis": 0,
          "write_load": 1.9320783065731747e-8
        }
      }
    }
  }
}

```

But for search, `GET /_nodes/stats?filter_path=nodes.*.indices.search.*`, we only can get this:

```auto
{
  "nodes": {
    "blAww4iBQU6UXUjMxfFrkw": {
      "indices": {
        "search": {
          "open_contexts": 0,
          "query_total": 22258362,
          "query_time_in_millis": 817437,
          "query_current": 0,
          "fetch_total": 22258334,
          "fetch_time_in_millis": 62839,
          "fetch_current": 0,
          "scroll_total": 19280,
          "scroll_time_in_millis": 453502,
          "scroll_current": 0,
          "suggest_total": 0,
          "suggest_time_in_millis": 0,
          "suggest_current": 0
        }
      }
    }
  }
}

```

No failure metric.  
Is there any other way to get search-failure rate?

---

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [August 10, 2024, 4:48am UTC](https://discuss.elastic.co/t/why-es-doesnt-have-search-failure-rate-metric/363936/2 "2024-08-10T04:48:58Z")

</div>

Hi @Ferrari248  
Thank you for your question!

An indexing failure is a condition where a document cannot be indexed for various reasons (version conflict, conflicting mappings, etc)

Can you elaborate on how would you define "search failures"?
