elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
112 stars 4.93k forks source link

[metricbeat] elasticsearch module, I want a feature that index metricset includes fetch_count #26805

Open bydeath opened 3 years ago

bydeath commented 3 years ago

https://github.com/elastic/beats/blob/638d20c0348de7f410692fae298d23f46065aaf5/metricbeat/module/elasticsearch/index/data.go#L89-L92 There are only two field query_total and query_time_in_millis now in metricbeat elasticsearch module. I want a feature thant index metricset include fetch_count, thus the index .motoring-es-7-mb-YYYY.mm.dd would record how many time indices are queried in a specified period.

In fact, the response of index _stats API includes fetch_total. Below is an example.

request:

GET test/_stats/search?filter_path=indices.*.total

response:

{
  "indices" : {
    "test" : {
      "total" : {
        "search" : {
          "open_contexts" : 0,
          "query_total" : 0,
          "query_time_in_millis" : 0,
          "query_current" : 0,
          "fetch_total" : 0,
          "fetch_time_in_millis" : 0,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_current" : 0
        }
      }
    }
  }
}
elasticmachine commented 3 years ago

Pinging @elastic/integrations (Team:Integrations)

ChrsMark commented 3 years ago

cc: @sayden

sayden commented 3 years ago

I don't see why not. I opened a PR to add that field https://github.com/elastic/beats/pull/27266