# ElasticSearch \`Search\` Usage Metrics and total queries count

**URL:** https://discuss.elastic.co/t/elasticsearch-search-usage-metrics-and-total-queries-count/259335
**Category:** Elasticsearch
**Created:** [December 22, 2020, 6:28am UTC](https://discuss.elastic.co/t/elasticsearch-search-usage-metrics-and-total-queries-count/259335 "2020-12-22T06:28:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sb\_chat\_v1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sb_chat_v1/32/81232_2.png) [@sb\_chat\_v1](https://discuss.elastic.co/u/sb_chat_v1)
#### Post date: [December 22, 2020, 6:28am UTC](https://discuss.elastic.co/t/elasticsearch-search-usage-metrics-and-total-queries-count/259335/1 "2020-12-22T06:28:20Z")

</div>

We have a use-case which requires us to maintain count of total search queries. We need to do this on an index or index-alias basis and for this we are passing in a custom stats-group (as part of the `_search` request). Now, the current problem is on how we can robustly get queries count. We tried using the following metrics via stats-endpoint - `fetch_total` and `query_total` . `Query_total` metric seems to be dependent on shard count and hence seems unviable for usage. So, posting this question to hear your recommendations.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 19, 2021, 6:28am UTC](https://discuss.elastic.co/t/elasticsearch-search-usage-metrics-and-total-queries-count/259335/2 "2021-01-19T06:28:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
