# How to config prometheus integration to scrape metrics from k8s pod

**URL:** <https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468>\
**Category:** Metrics\
**Tags:** elastic-stack-monitoring, fleet\
**Created:** [May 14, 2024, 1:21pm UTC](https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468 "2024-05-14T13:21:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terran\_Yiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/terran_yiu/32/4358_2.png) [@Terran\_Yiu](https://discuss.elastic.co/u/Terran_Yiu)\
**Post date:** [May 14, 2024, 1:21pm UTC](https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468/1 "2024-05-14T13:21:43Z")

</div>

I'm using fleet-managed elastic agents installed in k8s. I want to scrape pod metrics by HTTP API. My current config is in the following picture:

 ![截屏2024-05-14 21.17.48](https://us1.discourse-cdn.com/elastic/original/3X/8/1/819bbce240960e670e3a8d12abcb63cf508e55d9.png)

But it does not work, any suggestions?

---

<div class="post-metadata">

**Author:** ![Terran\_Yiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/terran_yiu/32/4358_2.png) [@Terran\_Yiu](https://discuss.elastic.co/u/Terran_Yiu)\
**Post date:** [May 14, 2024, 3:05pm UTC](https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468/2 "2024-05-14T15:05:55Z")

</div>

All registered providers are enabled by default, so I don't need to config k8s provider. But I don't know why there is no data at all...

---

<div class="post-metadata">

**Author:** ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)\
**Post date:** [May 14, 2024, 5:08pm UTC](https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468/3 "2024-05-14T17:08:03Z")

</div>

Hi @Terran_Yiu, welcome to the Elastic community again. Have you enabled the [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics) ?

---

<div class="post-metadata">

**Author:** ![Terran\_Yiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/terran_yiu/32/4358_2.png) [@Terran\_Yiu](https://discuss.elastic.co/u/Terran_Yiu)\
**Post date:** [May 15, 2024, 12:49am UTC](https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468/4 "2024-05-15T00:49:49Z")

</div>

@ashishtiwari1993 No, but I believe that the kubelet endpoint's access permissions are sufficient to fetch pod information.

It might be helpful to include this tip in the documentation: it is necessary to install `kube-state-metrics` for Prometheus when using it in Kubernetes.

---

<div class="post-metadata">

**Author:** ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)\
**Post date:** [May 15, 2024, 2:43pm UTC](https://discuss.elastic.co/t/how-to-config-prometheus-integration-to-scrape-metrics-from-k8s-pod/359468/5 "2024-05-15T14:43:31Z")

</div>

It is already mentioned in the [Getting started doc](https://www.elastic.co/getting-started/observability/monitor-kubernetes-clusters). You can follow these steps.
