We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc067bf commit 82a6fe3Copy full SHA for 82a6fe3
instrumentation/kamon-akka-http/src/main/scala/kamon/instrumentation/akka/http/VersionFiltering.scala
@@ -2,7 +2,17 @@ package kamon.instrumentation.akka.http
2
3
trait VersionFiltering {
4
def onAkkaHttp(version: String)(block: => Unit): Unit = {
5
- if(akka.http.Version.current.startsWith(version))
+ val akkaHttpVersion = getVersion
6
+
7
+ if (akkaHttpVersion.exists(_.startsWith(version)))
8
block
9
}
10
11
+ private def getVersion: Option[String] = {
12
+ try {
13
+ Option(akka.http.Version.current)
14
+ } catch {
15
+ case _: Throwable => None
16
+ }
17
18
0 commit comments