I want to statistics API requests in my Spring Boot 2 application,
Total number of requests processed
Total number of requests resulted in an OK response
Total number of requests resulted in a 4xx response
Total number of requests resulted in a 5xx response
Average response time of all requests
Max response time of all requests
I want to use Spring Boot Actuator and Micrometer, specifically, actuator/metrics/http.server.requests
But I have issues working with tag, Do I need any special configuration for the tag working? Thanks in advance.



UPDATE:
Finally, Both http://localhost:8080/travel/actuator/metrics/http.server.requests?tag=uri:/test/1 and http://localhost:8080/travel/actuator/metrics/http.server.requests?tag=status:200 work, by removing the second context path, /travel.
While making a request to /http.server.requests which only requires the endpoint of API to get the metrics for the particular endpoint.
As the application has a context path defined as the i.e /travel which is only required for making a request to endpoints.
Will work fine
http://localhost:8080/travel/actuator/metrics/http.server.requests?tag=uri:/test/1
do not work because of the context path in tag=uri
http://localhost:8080/travel/actuator/metrics/http.server.requests?tag=uri:/travel/test/1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With