Fix missing spans (#271)

This commit is contained in:
KirillPamPam
2023-08-07 13:36:04 +04:00
committed by GitHub
parent 2452070662
commit e969e61041

View File

@@ -23,7 +23,7 @@ class ProviderSpanHandler(
.build<String, MutableList<MutableSpan>>()
override fun end(context: TraceContext, span: MutableSpan, cause: Cause): Boolean {
if (span.traceId().length > 20) {
if (span.traceId().length > 20 && cause == Cause.FINISHED) {
val key = span.parentId() ?: span.id()
val spanList = spans.asMap().computeIfAbsent(key) { mutableListOf() }
spanList.add(span)