Kamon icon indicating copy to clipboard operation
Kamon copied to clipboard

Kamon Akka-Http PathMatcher issue

Open mladens opened this issue 4 years ago • 1 comments

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("")}")
  }

mladens avatar Jan 20 '21 09:01 mladens

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)

SimunKaracic avatar Jan 28 '21 15:01 SimunKaracic