Skip to content

Commit 641935c

Browse files
committed
Return Span instead of option
1 parent 4b1b1da commit 641935c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

instrumentation/kamon-redis/src/main/scala/kamon/instrumentation/jedis/JedisInstrumentation.scala

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@ object SendCommandAdvice {
1818
command match {
1919
case command: ProtocolCommand =>
2020
val spanName = s"redis.command.${command}"
21-
Some(Kamon.clientSpanBuilder(spanName, "redis.client.jedis")
22-
.start())
23-
case _ => None
21+
Kamon.clientSpanBuilder(spanName, "redis.client.jedis")
22+
.start()
23+
case _ => Span.Empty
2424
}
2525
}
2626

2727
@Advice.OnMethodExit(onThrowable = classOf[Throwable])
28-
def exit(@Advice.Enter span: Option[Span],
28+
def exit(@Advice.Enter span: Span,
2929
@Advice.Thrown t: Throwable) = {
30-
3130
if (t != null) {
32-
span.map(_.fail(t))
31+
span.fail(t)
3332
}
34-
span.map(_.finish())
33+
span.finish()
3534
}
3635
}

0 commit comments

Comments
 (0)