elastic icon indicating copy to clipboard operation
elastic copied to clipboard

Node Stats API in 7.15 broken

Open olivere opened this issue 4 years ago • 1 comments

Seems like the Node Stats API in 7.15.0 is broken due to this change (reported here). See also https://github.com/elastic/elasticsearch/issues/78311.

How to reproduce:

  1. Use 7.15.0
  2. Run the Node Stats API with level=shards: $ curl -H 'Content-Type: application/json' -XGET 'http://localhost:9200/_nodes/stats?level=shards&human=true&pretty=true'

Expected outcome:

All JSON keys on the same level are different.

Actual response:

You'll get a duplicate JSON key for shards:

      ...
      "indices" : {
        "docs" : {
          "count" : 48,
          "deleted" : 0
        },
        "shards" : {                   // <--
          "total_count" : 2
        },
        ...
        "shards" : {                   // <--
          ".tasks" : [
            {
              "0" : {
                "routing" : {
                  "state" : "STARTED",
                  "primary" : true,
                  "node" : "f8Z10TwPSKqTNsnnJiFRtg",
                  "relocating_node" : null
                },
                "docs" : {
                  "count" : 5,
                  "deleted" : 0
                },
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        ...

olivere avatar Sep 27 '21 09:09 olivere

As mentioned here, it needs to be renamed to shard_stats (not shards_stats as in my PR).

olivere avatar Mar 31 '22 07:03 olivere