end spans on cancel
This commit is contained in:
@@ -33,16 +33,16 @@ class SpannedReader<K, D>(
|
||||
return reader.read(key)
|
||||
.contextWrite { ReactorSleuth.putSpanInScope(tracer, it, newSpan) }
|
||||
.doOnError {
|
||||
newSpan.apply {
|
||||
tag(SPAN_ERROR, "true")
|
||||
tag(SPAN_STATUS_MESSAGE, it.message)
|
||||
end()
|
||||
}
|
||||
newSpan.tag(SPAN_ERROR, "true")
|
||||
.tag(SPAN_STATUS_MESSAGE, it.message)
|
||||
.end()
|
||||
}
|
||||
.doOnNext { newSpan.end() }
|
||||
.doOnCancel {
|
||||
newSpan.tag(SPAN_STATUS_MESSAGE, "cancelled").end()
|
||||
}
|
||||
.switchIfEmpty {
|
||||
newSpan.tag(SPAN_READER_RESULT, "empty result")
|
||||
newSpan.end()
|
||||
newSpan.tag(SPAN_READER_RESULT, "empty result").end()
|
||||
Mono.empty()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +124,9 @@ open class NativeCall(
|
||||
)
|
||||
}
|
||||
.doOnNext { callRes -> completeSpan(callRes, requestCount) }
|
||||
.doOnCancel {
|
||||
tracer.currentSpan()?.tag(SPAN_STATUS_MESSAGE, "cancel")?.end()
|
||||
}
|
||||
.contextWrite { ctx -> createTracingReactorContext(ctx, requestCount, requestId, requestSpan) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user