Metric to count number of queries per day/month

Hi @Ayush_Mathur
I tried testing the method you suggested with a test cluster that runs on 2 data nodes. I have an index named test, with 3 shards, 1 replica, and 2 documents.
This is what I see:

  • Checked _nodes/stats/indices first and I see:
    .nodes.*.indices.search.query_total shows 339 and 6851 (Total: 7190)
    .nodes.*.indices.search.fetch_total shows 7 and 761 (Total: 768)
  • Ran GET test/_search on Kibana Console and I get:
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 3,
    "successful" : 3,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 2,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "test",
        "_type" : "_doc",
        "_id" : "UyNs24IBF2DHLrbLO01N",
        "_score" : 1.0,
        "_source" : {
          "number" : 10
        }
      },
      {
        "_index" : "test",
        "_type" : "_doc",
        "_id" : "Jwts24IBfmjNTyhJVVal",
        "_score" : 1.0,
        "_source" : {
          "number" : 11
        }
      }
    ]
  }
}
  • Checked _nodes/stats/indices again and I see:
    .nodes.*.indices.search.query_total shows 339 and 6854 (Total: 7193)
    .nodes.*.indices.search.fetch_total shows 7 and 763 (Total: 770)

This is surprising to me since query_total was increased by 3 and fetch_total was increased by 2. I was expecting to see the query_total increasing just by 1 since I only ran 1 query.
My goal is to see how many queries are flowing to our cluster and report aggregated statistics daily/monthly.

If query_total or fetch_total are not suitable for what I need, is there another metric that I can use?

Another question: are those metrics increasing for the lifetime of the cluster or they reset to 0 at some point?