Skip to content

Indices stats API should provide external refresh stats #36712

@clandry94

Description

@clandry94

Describe the feature:

Currently, refresh stats are contained at the index level are an average of all shard refreshes within that index and exposed through the _stats api. Likewise, individual shards do collect refresh statistics, but only for INTERNAL refresh events and these statistics are not publicly accessible through the rest API.

I'm proposing the following two features to be added to elasticsearch:

  1. A mechanism or data structure to distinguish between EXTERNAL and INTERNAL refreshes within shards
    2) Extending the _stats to provide shard level refresh statistics. this is already implemented e.g.
GET /my_index/_stats/refresh

would respond with

{
  "_shards" : {
    "total" : 800,
    "successful" : 800,
    "failed" : 0
  },
  "_all" : {
    "primaries" : {
      "refresh" : {
        "total" : 3952969,
        "total_time_in_millis" : 325583210,
        "listeners" : 0
      }
    },
    "total" : {
      "refresh" : {
        "total" : 7898248,
        "total_time_in_millis" : 649856023,
        "listeners" : 0
      }
    }
  },
  "indices" : {
    "products.3" : {
      "uuid" : "rFXl6ARRXRIiXVjKlh4qLEw",
      "primaries" : {
        "refresh" : {
          "total" : 3952969,
          "total_time_in_millis" : 325583210,
          "listeners" : 0
        }
      },
      "total" : {
        "refresh" : {
          "total" : 7898248,
          "total_time_in_millis" : 649856023,
          "listeners" : 0
        }
      }
     "shards": [
       { 
         "id": 1,
         "refresh" : {
          "total" : 9050918,
          "total_time_in_millis" : 948194819,
          "listeners" : 0
        }
      },
      { 
         "id": 2,
         "refresh" : {
          "total" : 412740,
          "total_time_in_millis" : 4921479849,
          "listeners" : 0
        }
      },
     ]
    }
  }
}

Related issue and prior discussion with @s1monw #36541

I can take on this and start working on it if all looks good 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed Indexing/EngineAnything around managing Lucene and the Translog in an open shard.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions