Skip to content

Commit 2d644f3

Browse files
DefaultContextPropagators is not public anymore, we should use ContextPropagators with a composite TextMapPropagator (MultiTextMapPropagator).
1 parent d29da22 commit 2d644f3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

spring-cloud-sleuth-otel-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelAutoConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,5 @@ Sampler otelSampler(OtelProperties otelProperties) {
147147
SleuthContextListener sleuthContextListener() {
148148
return new SleuthContextListener();
149149
}
150+
150151
}

spring-cloud-sleuth-otel-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfiguration.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import io.opentelemetry.context.Context;
2424
import io.opentelemetry.context.propagation.ContextPropagators;
25-
import io.opentelemetry.context.propagation.DefaultContextPropagators;
2625
import io.opentelemetry.context.propagation.TextMapPropagator;
2726

2827
import org.springframework.beans.factory.BeanFactory;
@@ -62,9 +61,8 @@ ContextPropagators otelContextPropagators(ObjectProvider<List<TextMapPropagator>
6261
if (mapPropagators.isEmpty()) {
6362
return noOpContextPropagator();
6463
}
65-
DefaultContextPropagators.Builder builder = DefaultContextPropagators.builder();
66-
mapPropagators.forEach(builder::addTextMapPropagator);
67-
return builder.build();
64+
65+
return ContextPropagators.create(TextMapPropagator.composite(mapPropagators));
6866
}
6967

7068
private ContextPropagators noOpContextPropagator() {

0 commit comments

Comments
 (0)