title: Spring Boot application monitoring with Prometheus
body: <p>We are working on the Monitoring and Alerting mechanism for Spring boot application hosted on the physical server. After some research, decided to go with</p>
  
  <blockquote>
    <p>Actuators  - To monitor application in every aspects</p>
    
    <p>Prometheus - Metric store</p>
    
    <p>Grafana    - For Dashboard visualization and alerting </p>
  </blockquote>
  
  <p>Everything going well until Prometheus comes in to the picture. Am facing an issue in feeding the metrics to metric store. </p>
  
  <p><strong>prometheus.yml</strong></p>
  
  <p><code>scrape_configs:
    - job_name: 'spring-actuator'
      metrics_path: '/actuator/prometheus'
      scrape_interval: 5s
      static_configs:
      - targets: ['localhost:8080']
  </code></p>
  
  <p><strong>Prometheus server logs</strong></p>
  
  <blockquote>
    <p>level=info ts=2020-02-05T15:05:20.873Z caller=main.go:762 msg="Completed loading of configuration file" filename=prometheus.yml
    level=info ts=2020-02-05T15:05:20.873Z caller=main.go:617 msg="Server is ready to receive web requests."</p>
  </blockquote>
  
  <p>Prometheus Dashboard showing <strong>no data to display</strong>.</p>
  
  <p>Side Note, Spring Boot Services are up and it returning data when localhost:8080/actuator/prometheus is being hit. Disabled the sensitivity of Actuator endpoints.</p>
  
  <p>actuator/prometheus endpoint result:</p>
  
  <p><a href="https://i.stack.imgur.com/HDnUp.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HDnUp.gif" alt="Spring Boot Micrometer Resp"></a></p>