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)