Skip to content

Commit

Permalink
fix context closing, we were calling Kamon.storeContext but not closing
Browse files Browse the repository at this point in the history
the resulting scope
  • Loading branch information
jtjeferreira committed Mar 13, 2018
1 parent c63fa49 commit e37aafc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ class Instrumentation {
.customize(clientSpanBuilder)
.start()

val newContext = currentContext.withKey(Span.ContextKey, clientRequestSpan)
Kamon.storeContext(newContext) //storing the current context is important so that in other instrumentations the current Span is correct

val responseFuture = pjp.proceed().asInstanceOf[Future[_]]
//storing the current context is important so that in other instrumentations the current Span is correct
val responseFuture = Kamon.withContext(currentContext.withKey(Span.ContextKey, clientRequestSpan)) {
pjp.proceed().asInstanceOf[Future[_]]
}

responseFuture.transform(
s = response => {
Expand Down

0 comments on commit e37aafc

Please sign in to comment.