Skip to content

Commit

Permalink
Merge pull request #18 from fiadliel/PlayRouteParsingIssue
Browse files Browse the repository at this point in the history
Removed broken regex and replaced with a replace all
  • Loading branch information
fiadliel authored Dec 20, 2016
2 parents 26c30e7 + d5938fb commit a0b566b
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class PrometheusFilter @Inject()(implicit
) extends Filter {
private final val ServerErrorClass = "5xx"

private final val RouteRegex = "^/[^<]*".r

private val httpHistogramBuckets = {
val buckets = for (p <- Vector[Double](0.0001, 0.001, 0.01, 0.1, 1, 10);
s <- Vector(1, 2, 5)) yield (p * s)
Expand Down Expand Up @@ -68,8 +66,7 @@ class PrometheusFilter @Inject()(implicit
for {
method <- requestHeader.tags.get("ROUTE_VERB")
routePattern <- requestHeader.tags.get("ROUTE_PATTERN")
routeTemplate <- RouteRegex findFirstIn routePattern
route = routeTemplate.replaceAll("\\$", ":")
route = routePattern.replaceAll("<.*>", "").replaceAll("\\$", ":")
} yield RouteDetails(method, route)
}

Expand Down

0 comments on commit a0b566b

Please sign in to comment.