Micrometer for http requests: URI templating not working with interfaces
See original GitHub issueDescribe the bug
Hello,
While integrating Micrometer into our application, checking the http metrics and more specifically the URI, I could see that in some case it was not templatized. It seems to come from the fact that we used in some case an API instead of annotating the class directly and in this case it seems the @Path annotation is not used to resolve the template URI.
Best Regards
Expected behavior
Have a tag with the template URI instead of the whole URI
Actual behavior
Full URI is set as metric tag.
How to Reproduce?
This is a small reproducer that contains the two versions of a dummy resource, one usin an API, the other no to highlight the difference.
Output of uname -a
or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Micrometer Metrics - Quarkus
Micrometer is the recommended approach to metrics for Quarkus. ... Dimensional labels have been added for the requested uri, the HTTP method (GET,...
Read more >53. Metrics - Spring
Metrics will, by default, be generated with the name http.server.requests . ... Request's method,; Request's URI (templated if possible); Simple class name ...
Read more >Expose Metrics of Spring WebClient using Spring Boot Actuator
Monitoring the outcome of your HTTP calls is essential in a ... want the templated URI string like "/todos/{id}" for reporting and not...
Read more >Templated URLs in Prometheus End Point with Jersey and ...
Looks like there is an open issue with micrometer listed at https://github.com/micrometer-metrics/micrometer/issues/486 which causes this issue ...
Read more >Home of Quarkus Cheat-Sheet - GitHub Pages
If hal is true , you need to send the Accept: application/hal+json HTTP header to get the response. Hibernate Reactive ./mvnw quarkus:add-extension -Dextensions ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Right. If I allowed use of replaceAll, you could specify the match string like this:
/v1/api/[^/]+/([^/]+)/.*=/v1/api/{param1}/$1/{param3}
(single group)You should set the match pattern as that gets you out of trouble right now, there are some things I’m waiting for to fix this issue, but the match pattern will continue to work regardless (at some future point, you may not need it, but it will work, so… )