Kamon
Kamon copied to clipboard
Kamon Akka-Http PathMatcher issue
Scala 2.12.2
Kamon 2.1.8
After upgrading to akka-http to 10.2.2
operation names end up containing raw path instead of replacing matched sections with a special characte.
In this example we'd expect the operation name to be: /foo/bar/X{}/edit
val matcher: PathMatcher1[Option[Int]] =
"foo" / "bar" / "X" ~ IntNumber.? / ("edit" | "create")
val route: Route =
path(matcher) { i: Option[Int] =>
complete(s"Matched X${i.getOrElse("")}")
}
This appears to be an edge case in our PathMatching regex, but it has nothing to do with the upgrade to akka 10.2.2
.
I gave it a go, but dropped it before I dig myself too deep.
If anyone wants to play around with it, give it a go https://regex101.com/r/Dqesz9/1 (every line should match only the 4 after the X)