Metricbeat error fetching kube-state-metrics

I am getting the following error in metricbeat deployment that is configured to fetch and push metrics from kube-state-metrics.

2021-06-30T19:25:11.318Z	ERROR	[kubernetes.state_statefulset]	state_statefulset/state_statefulset.go:97	decoding of metric family failed: context deadline exceeded (Client.Timeout or context cancellation while reading body)

Metricbeat Image: docker.elastic.co/beats/metricbeat:7.13.0
Metricbeat config:

metricbeat:
  modules:
  - add_metadata: "true"
    hosts:
    - kube-state-metrics.monitoring:8080
    metricsets:
    - state_node
    - state_daemonset
    - state_deployment
    - state_replicaset
    - state_statefulset
    - state_pod
    - state_container
    - state_cronjob
    - state_persistentvolume
    - state_persistentvolumeclaim
    module: kubernetes
    period: 10s
output:
  elasticsearch:
    hosts:
    - https://gs-monitor-es-http.monitoring.svc:9200
    password: REDACTED
    ssl:
      certificate_authorities:
      - /mnt/elastic-internal/elasticsearch-certs/ca.crt
    username: metricbeat
setup:
  dashboards:
    enabled: true
  kibana:
    host: https://gs-monitor-kb-http.monitoring.svc:5601
    password: REDACTED
    ssl:
      certificate_authorities:
      - /mnt/elastic-internal/kibana-certs/ca.crt
    username: metricbeat

I think metricbeat is timing out getting the metrics from kube-state-metrics but I am not sure how to fix this. Any help will be much appreciated. Thanks!

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