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() {}