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

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:

{
  "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:

{
  "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?

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"?

1 Like