Followed steps given below to send Metrics from Spring Boot to Prometheus:
In pom.xml added this:
<parent>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 :-
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.0Now, 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.0and 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.0Due 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=testAny help shall be highly appreciated. Kindly help .