From e14b977109f44d2b77e09c2895e387895d20f44f Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Tue, 21 Nov 2023 14:14:58 +0200 Subject: [PATCH] Fix aws propagator presence check --- .../propagators/CompositeTextMapPropagatorFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/CompositeTextMapPropagatorFactory.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/CompositeTextMapPropagatorFactory.java index 7b418ff5b0b0..8716b70bd099 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/CompositeTextMapPropagatorFactory.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/CompositeTextMapPropagatorFactory.java @@ -68,7 +68,7 @@ static TextMapPropagator getCompositeTextMapPropagator( } break; case "xray": - if (isOnClasspath("io.opentelemetry.contrib.awsxray.AwsXrayPropagator")) { + if (isOnClasspath("io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator")) { propagators.add( beanFactory .getBeanProvider(AwsXrayPropagator.class) @@ -91,7 +91,7 @@ static TextMapPropagator getCompositeTextMapPropagator( } private static boolean isOnClasspath(String clazz) { - return ClassUtils.isPresent(clazz, null); + return ClassUtils.isPresent(clazz, CompositeTextMapPropagatorFactory.class.getClassLoader()); } private CompositeTextMapPropagatorFactory() {}