question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Micrometer for http requests: URI templating not working with interfaces

See original GitHub issue

Describe 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?

micrometer_reproducer.zip

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:open
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ebullientcommented, Apr 26, 2022

Right. If I allowed use of replaceAll, you could specify the match string like this: /v1/api/[^/]+/([^/]+)/.*=/v1/api/{param1}/$1/{param3} (single group)

1reaction
ebullientcommented, Apr 25, 2022

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… )

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found