From e969e6104153cf0232bc64dc8298401ca013b944 Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Mon, 7 Aug 2023 13:36:04 +0400 Subject: [PATCH] Fix missing spans (#271) --- .../io/emeraldpay/dshackle/config/spans/ProviderSpanHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/spans/ProviderSpanHandler.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/spans/ProviderSpanHandler.kt index c52157e4..6189e0cd 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/spans/ProviderSpanHandler.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/spans/ProviderSpanHandler.kt @@ -23,7 +23,7 @@ class ProviderSpanHandler( .build>() 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)