Actuator Metrics in springboot stops working after 2 hours

23 views
Skip to first unread message

aditya goel

unread,
Aug 27, 2020, 11:03:48 AM8/27/20
to Prometheus Users

Followed steps given below to send Metrics from Spring Boot to Prometheus:

In pom.xml added this:

<parent> 
  <groupId>org.springframework.boot</groupId> 
  <artifactId>spring-boot-starter-parent</artifactId> 
  <version>2.0.0.RELEASE</version> 
  <relativePath /> 
  </parent> 

  <dependency> 
  <groupId>io.micrometer</groupId> 
  <artifactId>micrometer-registry-prometheus</artifactId> 
  </dependency> 

  <dependency> 
  <groupId>org.springframework.boot</groupId> 
  <artifactId>spring-boot-starter-actuator</artifactId> 
</dependency>


Say, we started our spring boot microservice at t=0, and then we observed the actuator-metrics. At t=0, actuator-metrics appear to be coming absolutely fine.

  • URL at which checked the metrics :- https://:8080/actuator/prometheus

  • Metric checked for :-

http_server_requests_seconds_count{application="Prod-MS",exception="None",method="POST",status="200",uri="/api/customers/createCustomer",team="ABC",} 166.0


Upon rehitting this url again within some seconds, this metric gets updated, since traffic is coming constantly !

http_server_requests_seconds_count{application="Prod-MS",exception="None",method="POST",status="200",uri="/api/customers/createCustomer",team="ABC",} 171.0


Now, at time t=3 hours or sometimes t=2.5 hours, these metrics stops getting updated and becomes constant at some random value:- At this time, application is working perfectly fine.

http_server_requests_seconds_count{application="Prod-MS",exception="None",method="POST",status="200",uri="/api/customers/createCustomer",team="ABC",} 1120.0

and it becomes constant at some random value :-

http_server_requests_seconds_count{application="Prod-MS",exception="None",method="POST",status="200",uri="/api/customers/createCustomer",team="ABC",} 1120.0


Due to this issue, we are not able to do the monitoring from Prometheus, as metrics are not coming from actuator itself.

Once the application is taken restart, the problem solves and again after 3 hours, metrics stops coming.



Following are the properties we have set :-

management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always management.metrics.enable.http.client.requests=true management.metrics.distribution.percentiles-histogram.http.client.requests=true management.metrics.enable.http.server.requests=true management.metrics.distribution.percentiles-histogram.http.server.requests=true management.metrics.tags.tag=test

Any help shall be highly appreciated. Kindly help .

aditya goel

unread,
Sep 7, 2020, 10:30:28 AM9/7/20
to Prometheus Users
Bumping this thread for wider reach ~!!
Reply all
Reply to author
Forward
0 new messages