open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.12k stars 2.39k forks source link

Add indice count to scrapped metrics #36215

Open nathan-maves opened 3 weeks ago

nathan-maves commented 3 weeks ago

Component(s)

receiver/elasticsearch

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

I would like to monitor the number of indices of a cluster from the /_cluster/stats endpoint.

Describe the solution you'd like

Add the indice count to the collected metrics for each index. The /_cluster/stats endpoint contains the indecies.count.

{
  "_nodes": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "cluster_name": "...",
  "cluster_uuid": "...",
  "timestamp": 1730819858617,
  "status": "yellow",
  "indices": {
    "count": 564,
    "shards": {
      "total": 1140,
      "primaries": 570,
      "replication": 1,
      "index": {
        "shards": {
          "min": 1,
          "max": 4,
          "avg": 2.021276595744681
        },
        "primaries": {
          "min": 1,
          "max": 2,
          "avg": 1.0106382978723405
        },
        "replication": {
          "min": 0,
          "max": 2,
          "avg": 1
        }
      }
    }
  }
}

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 3 weeks ago

Pinging code owners: