Skip to content

Commit a920898

Browse files
committed
Use nextSpan instead of joinSpan
To account for the case when `contextOrFlags.context() == null`
1 parent b9ad0ce commit a920898

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/scala/brave/play/ZipkinTraceServiceLike.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2017-2020 The OpenZipkin Authors
2+
* Copyright 2017-2021 The OpenZipkin Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -183,7 +183,8 @@ trait ZipkinTraceServiceLike {
183183
(carrier: A, key: String) => getHeader(carrier, key).orNull
184184
).extract(headers)
185185

186-
tracer.joinSpan(contextOrFlags.context())
186+
Option(contextOrFlags.context())
187+
.map(tracer.joinSpan).getOrElse(tracer.nextSpan(contextOrFlags))
187188
}
188189

189190
/**

0 commit comments

Comments
 (0)