<p>I installed my Spring Boot application with 2 or 3 pods on Kubernetes in Linux Server. And to monitor it, I installed Prometheus, too. Currently, the metrics from application to Prometheus go very well.</p>
<p>But I suspect that Prometheus takes metrics from only one pod. With a job like below in Prometheus config file, does prometheus takes metrics only from one pod? How can I make Prometheus scrape all pods in same time?</p>
<pre><code>- job_name: 'SpringBootPrometheusDemoProject'
  metrics_path: '/SpringBootPrometheusDemoProject/actuator/prometheus'
  scrape_interval: 5s
  static_configs:
  - targets: ['127.0.0.1:8080']
</code></pre>

İlkay Gunel
<p>Yes. In this case, you have to add few annotations in your pod (if it does not exist already) and use <code>kubernetes_sd_configs</code> instead of <code>static_configs</code>.</p>
<p>You will find an example here: <a href="https://github.com/appscode/third-party-tools/blob/master/monitoring/prometheus/builtin/README.md#kubernetes-pod" rel="nofollow noreferrer">https://github.com/appscode/third-party-tools/blob/master/monitoring/prometheus/builtin/README.md#kubernetes-pod</a></p>
