Skip to content

Add shard count to the Elasticsearch index stats scrapper #35858

@nathan-maves

Description

@nathan-maves

Component(s)

receiver/elasticsearch

Is your feature request related to a problem? Please describe.

I was trying to be able to compare 3 dimensions of Elasticsearch index stats document count, shards size and shard count but this receiver only scapes 2 of the 3 from the /_stats endpoint.

Describe the solution you'd like

Add the shard count to the collected metrics for each index. The /users/_stats endpoint contains the total_count for shards.

{
  "_shards": {
    "total": 6,
    "successful": 6,
    "failed": 0
  },
  "_all": {
    "primaries": {
      "docs": {
        "count": 599007114,
        "deleted": 6255158,
        "total_size_in_bytes": 106202644463
      },
      "shard_stats": {
        "total_count": 3
      }
    },
    "total": {
      "docs": {
        "count": 1198014228,
        "deleted": 12506844,
        "total_size_in_bytes": 212356147240
      },
      "shard_stats": {
        "total_count": 6
      }
    }
  },
  "indices": {
    "users": {
      "uuid": "6UqMYhVwS4OwyngTqKG8ow",
      "health": "green",
      "status": "open",
      "primaries": {
        "docs": {
          "count": 599007114,
          "deleted": 6255158,
          "total_size_in_bytes": 106202644463
        },
        "shard_stats": {
          "total_count": 3
        }
      },
      "total": {
        "docs": {
          "count": 1198014228,
          "deleted": 12506844,
          "total_size_in_bytes": 212356147240
        },
        "shard_stats": {
          "total_count": 6
        }
      }
    }
  }
}

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions