Describe the bug
There are two issues I discovered
- On JDK 11, route matcher does not capture the
http.route attribute at all. As a result, the span name only encapsulates the HTTP method (e.g. GET).
- The span name and
http.route are neglecting slashes when computing the route.
I've made a draft fix here with all old and new tests passing on both reproduced JDK versions - 149f216
Steps to reproduce
Using updated tests from this fix commit 149f216 pointing to the instrumentation code on main, I'm able to confirm from logs for both cases. On JDK 11, both [1] and [2] are reproducible, and [2] is also reproducible in JDK 21 target.
- org.opentest4j.AssertionFailedError: [Span 0] Expected span to have name <GET /api/v2/orders/*/status> but was
- org.opentest4j.AssertionFailedError: [Span 0] Expected span to have name <GET /foo/api/v2/bar/> but was <GET /fooapiv2bar>
Expected behavior
Span names should have been
- GET /api/v2/orders/*/status
- GET /foo/api/v2/bar/*
http.route should have been
- /api/v2/orders/*/status
- /foo/api/v2/bar/*
Actual behavior
Span names were
- GET (JDK11)
- GET /fooapiv2bar* (JDK11 & JDK21)
http.route were
- Missing completely
- /fooapiv2bar*
Javaagent or library instrumentation version
2.23.0-alpha-SNAPSHOT
Environment
JDK: JDK 11 for the first issue, JDK 11 and 21 for the second
OS: MacOS 15.5
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe the bug
There are two issues I discovered
http.routeattribute at all. As a result, the span name only encapsulates the HTTP method (e.g.GET).http.routeare neglecting slashes when computing the route.I've made a draft fix here with all old and new tests passing on both reproduced JDK versions - 149f216
Steps to reproduce
Using updated tests from this fix commit 149f216 pointing to the instrumentation code on
main, I'm able to confirm from logs for both cases. On JDK 11, both [1] and [2] are reproducible, and [2] is also reproducible in JDK 21 target.Expected behavior
Span names should have been
http.routeshould have beenActual behavior
Span names were
http.routewereJavaagent or library instrumentation version
2.23.0-alpha-SNAPSHOT
Environment
JDK: JDK 11 for the first issue, JDK 11 and 21 for the second
OS: MacOS 15.5
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.