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