You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get metrics for this, but the uri isn't being captured by Micrometer:
# HELP http_client_requests_duration_seconds
# TYPE http_client_requests_duration_seconds summary
http_client_requests_duration_seconds_count{clientName="jsonplaceholder.typicode.com",method="GET",status="200",uri="none",} 1.0
http_client_requests_duration_seconds_sum{clientName="jsonplaceholder.typicode.com",method="GET",status="200",uri="none",} 0.164180339
I guess this is because io.micrometer.spring.RestTemplateUrlTemplateCapturingAspect only executes for RestOperations calls that have a String as their first argument, but calls using a URI object are also supported by RestTemplate (and RestOperations), so I guess those should also be intercepted?
The text was updated successfully, but these errors were encountered:
I added support for capturing URI's for this signature, but I want to caution you that it should only be used when the URI is not parameterizable. What you have right now would cause dimensional explosion on the backend.
// BAD - will result in dimensional explosion with enough requests
restTemplate.getForObject(new URI("https://jsonplaceholder.typicode.com/posts/1"), String.class);
// GOOD - will result in one URI dimension regardless of the number of requests
restTemplate.getForObject("https://jsonplaceholder.typicode.com/posts/{id}", String.class, 1);
I was testing the client-side HTTP instrumentation for Spring's
RestTemplate
as described at http://micrometer.io/docs/prometheus#_client_side_http_instrumentation using this REST controller method:I get metrics for this, but the uri isn't being captured by Micrometer:
I guess this is because
io.micrometer.spring.RestTemplateUrlTemplateCapturingAspect
only executes forRestOperations
calls that have aString
as their first argument, but calls using aURI
object are also supported byRestTemplate
(andRestOperations
), so I guess those should also be intercepted?The text was updated successfully, but these errors were encountered: