# Possible to set min\_doc\_count in TSVB?

**URL:** https://discuss.elastic.co/t/possible-to-set-min-doc-count-in-tsvb/208907
**Category:** Kibana
**Created:** [November 21, 2019, 2:31pm UTC](https://discuss.elastic.co/t/possible-to-set-min-doc-count-in-tsvb/208907 "2019-11-21T14:31:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tobias.berg](https://avatars.discourse-cdn.com/v4/letter/t/ac8455/32.png) [@tobias.berg](https://discuss.elastic.co/u/tobias.berg)
#### Post date: [November 21, 2019, 2:31pm UTC](https://discuss.elastic.co/t/possible-to-set-min-doc-count-in-tsvb/208907/1 "2019-11-21T14:31:52Z")

</div>

Hi,

I have a visualization built in TSVB that visualize cpu usage per kubernetes pod in a Time Series. This works fine in Kibana 6.x but after upgrading to 7.4.2 I get a "too many buckets" error message. The exact error message is `"error":{"error":{"root_cause":[{"type":"too_many_buckets_exception","reason":"Trying to create too many buckets. Must be less than or equal to: [10000] but was [10096]. This limit can be set by changing the [search.max_buckets] cluster level setting.","max_buckets":10000}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"metricbeat-7.4.1-2019.11.14-000001","node":"ayphGaJ8ROqSqBPVPJ4osg","reason":{"type":"too_many_buckets_exception","reason":"Trying to create too many buckets. Must be less than or equal to: [10000] but was [10096]. This limit can be set by changing the [search.max_buckets] cluster level setting.","max_buckets":10000}}]},"status":503}`

When I inspect the request sent to Elasticsearch, I see that TSVB sets min\_doc\_count:0, which will return a bucket for all pods that have ever existed. Since pods are recreated from time to time, there are a lot of buckets containing pods with 0 doc\_count. These pods are irrelevant to have. So I wonder if it's possible to set the min\_doc\_count in the TSVB somehow?

Here's a screenshot of my TSVB:

 ![tsvb-pods](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c54817194830583ee51a4513ff476bfbc1a60ce7.png)

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [November 21, 2019, 4:16pm UTC](https://discuss.elastic.co/t/possible-to-set-min-doc-count-in-tsvb/208907/2 "2019-11-21T16:16:15Z")

</div>

Hey @tobias.berg,

Unfortunately, this isn't possible to configure with TSVB at the moment. If you want, you can open a [feature request](https://github.com/elastic/kibana/issues/new?template=Feature_request.md) to have this considered.

---

<div class="post-metadata">

### Author: ![tobias.berg](https://avatars.discourse-cdn.com/v4/letter/t/ac8455/32.png) [@tobias.berg](https://discuss.elastic.co/u/tobias.berg)
#### Post date: [November 22, 2019, 12:44pm UTC](https://discuss.elastic.co/t/possible-to-set-min-doc-count-in-tsvb/208907/3 "2019-11-22T12:44:03Z")

</div>

Thanks for the answer, and link to the feature request form. Will look into this.

For now, I think we will solve the issue by just limiting the amount of pods in the aggregation.

Thanks!

/Tobias

---

<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: [December 20, 2019, 12:44pm UTC](https://discuss.elastic.co/t/possible-to-set-min-doc-count-in-tsvb/208907/4 "2019-12-20T12:44:12Z")

</div>

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