From 70ce25e7ae7b8b504705770486e3f0cc3b1eb592 Mon Sep 17 00:00:00 2001 From: Ralf Steppacher Date: Mon, 21 Oct 2024 12:26:04 +0200 Subject: [PATCH] Disable check for noop span implementation. --- .../com/swisscom/health/des/cdr/clientvm/TraceSupport.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/swisscom/health/des/cdr/clientvm/TraceSupport.kt b/src/main/kotlin/com/swisscom/health/des/cdr/clientvm/TraceSupport.kt index b8c2abd..ccd7ff8 100644 --- a/src/main/kotlin/com/swisscom/health/des/cdr/clientvm/TraceSupport.kt +++ b/src/main/kotlin/com/swisscom/health/des/cdr/clientvm/TraceSupport.kt @@ -18,9 +18,12 @@ object TraceSupport { val span: Span = tracer.spanBuilder().name(spanName).start() - require(span.toString().startsWith("PropagatedSpan")) { - "Expected an OpenTelemetry `PropagatedSpan` (which is a noop implementation) but got a ${span.javaClass.canonicalName} instead." - } + // TODO: Comment out for the time being. It appears the Azure Application Insights agent enables telemetry collection, + // which causes below test to fail. We need to investigate whether the unclosed span (we close the "Span in Scope" but + // not the span itself) causes a resource leak and if so, find another solution. See #37831. +// require(span.toString().startsWith("PropagatedSpan")) { +// "Expected an OpenTelemetry `PropagatedSpan` (which is a noop implementation) but got a ${span.javaClass.canonicalName} instead." +// } val spanInScope: SpanInScope = tracer.withSpan(span)