# Metricbeat Timeout Errors while scraping state metricset from kube-state-mertics

**URL:** https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931
**Category:** Beats
**Tags:** metricbeat
**Created:** [August 19, 2021, 8:45am UTC](https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931 "2021-08-19T08:45:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)
#### Post date: [August 19, 2021, 8:45am UTC](https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931/1 "2021-08-19T08:45:52Z")

</div>

I am running metricbeat deployment and daemonset using elasticsearch helm chart. In my metricbeat deployment I am collecting state metrics from the kube-state-metrics API from an openshift cluster and experience following errors from time to time:

```auto
2021-08-19T08:31:50.189Z	ERROR	[kubernetes.state_deployment]	state_deployment/state_deployment.go:98	decoding of metric family failed: context deadline exceeded (Client.Timeout or context cancellation while reading body)

```

```auto
2021-08-19T08:33:39.893Z	INFO	module/wrapper.go:259	Error fetching data for metricset kubernetes.state_container: error getting event: decoding of metric family failed: context deadline exceeded (Client.Timeout or context cancellation while reading body)

```

At the same time I see that some state metrics are getting indexed in elasticsearch and some I am missing. Maybe it is related to the timeouts I see in my metricbeat deployment

Thanks

---

<div class="post-metadata">

### Author: ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)
#### Post date: [August 20, 2021, 8:57am UTC](https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931/2 "2021-08-20T08:57:48Z")

</div>

I have inceased the ressources for my metricbeat deployment and it now seems to have no timeout errors

---

<div class="post-metadata">

### Author: ![riahc3](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@riahc3](https://discuss.elastic.co/u/riahc3)
#### Post date: [August 24, 2021, 3:30pm UTC](https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931/3 "2021-08-24T15:30:26Z")

</div>

Could you elaborate on what resources you increased?

---

<div class="post-metadata">

### Author: ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)
#### Post date: [August 25, 2021, 9:37am UTC](https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931/4 "2021-08-25T09:37:13Z")

</div>

I have increased the metricbeat **deployment** container resources to 1 CPU and 1Gi memory:

```auto
  resources:
    requests:
      cpu: "1"
      memory: "1Gi"
    limits:
      cpu: "1"
      memory: "1Gi"

```

---

<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: [September 22, 2021, 11:38am UTC](https://discuss.elastic.co/t/metricbeat-timeout-errors-while-scraping-state-metricset-from-kube-state-mertics/281931/5 "2021-09-22T11:38:11Z")

</div>

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