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 .

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/5fee26ec-084f-4193-8534-16bd2050e8e3n%40googlegroups.com.

Reply via email to