opentelemetry-java-instrumentation
opentelemetry-java-instrumentation copied to clipboard
Fix pekko route naming
There are a few problems with the http.route values generated in pekko's instrumentation.
- Path matching does not need to end with a
PathEndmatcher, as the current solution assumes, e.g.:
pathPrefix("foo" ~ not("bar")) { complete("ok") }
will match /fooabc/123, but no http.route is generated. Given the glob-style approach of using * to represent a captured variable, I suggest the correct http.route here should be /foo**.
pathPrefixdoesn't work as expected, e.g.
pathPrefix("a") {
pathPrefix("b") {
path("c") {
complete("ok")
}
}
}
will match /a/b/c, but the http.route generated is abc.
This solves those issues, and adds a variety of PathMatchers to the tests.
will match /fooabc/123, but no http.route is generated. Given the glob-style approach of using * to represent a captured variable, I suggest the correct http.route here should be /foo**
I personally would prefer /foo* to /foo**
@laurit @masonedmison any other comments?