|
|
@ -24,7 +24,6 @@ import java.util.Map;
|
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import io.micrometer.tracing.SpanCustomizer;
|
|
|
|
import io.micrometer.tracing.SpanCustomizer;
|
|
|
|
import io.micrometer.tracing.otel.bridge.OtelCurrentTraceContext;
|
|
|
|
import io.micrometer.tracing.otel.bridge.OtelCurrentTraceContext;
|
|
|
@ -209,8 +208,8 @@ class OpenTelemetryAutoConfigurationTests {
|
|
|
|
void shouldSupplyB3PropagationIfPropagationPropertySet() {
|
|
|
|
void shouldSupplyB3PropagationIfPropagationPropertySet() {
|
|
|
|
this.contextRunner.withPropertyValues("management.tracing.propagation.type=B3").run((context) -> {
|
|
|
|
this.contextRunner.withPropertyValues("management.tracing.propagation.type=B3").run((context) -> {
|
|
|
|
TextMapPropagator propagator = context.getBean(TextMapPropagator.class);
|
|
|
|
TextMapPropagator propagator = context.getBean(TextMapPropagator.class);
|
|
|
|
Stream<Class<?>> injectors = getInjectors(propagator).stream().map(Object::getClass);
|
|
|
|
List<TextMapPropagator> injectors = getInjectors(propagator);
|
|
|
|
assertThat(injectors).containsExactly(B3Propagator.class, BaggageTextMapPropagator.class);
|
|
|
|
assertThat(injectors).hasExactlyElementsOfTypes(B3Propagator.class, BaggageTextMapPropagator.class);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -220,8 +219,8 @@ class OpenTelemetryAutoConfigurationTests {
|
|
|
|
.withPropertyValues("management.tracing.propagation.type=B3", "management.tracing.baggage.enabled=false")
|
|
|
|
.withPropertyValues("management.tracing.propagation.type=B3", "management.tracing.baggage.enabled=false")
|
|
|
|
.run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
TextMapPropagator propagator = context.getBean(TextMapPropagator.class);
|
|
|
|
TextMapPropagator propagator = context.getBean(TextMapPropagator.class);
|
|
|
|
Stream<Class<?>> injectors = getInjectors(propagator).stream().map(Object::getClass);
|
|
|
|
List<TextMapPropagator> injectors = getInjectors(propagator);
|
|
|
|
assertThat(injectors).containsExactly(B3Propagator.class);
|
|
|
|
assertThat(injectors).hasExactlyElementsOfTypes(B3Propagator.class);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -242,8 +241,8 @@ class OpenTelemetryAutoConfigurationTests {
|
|
|
|
void shouldSupplyW3CPropagationWithoutBaggageWhenDisabled() {
|
|
|
|
void shouldSupplyW3CPropagationWithoutBaggageWhenDisabled() {
|
|
|
|
this.contextRunner.withPropertyValues("management.tracing.baggage.enabled=false").run((context) -> {
|
|
|
|
this.contextRunner.withPropertyValues("management.tracing.baggage.enabled=false").run((context) -> {
|
|
|
|
TextMapPropagator propagator = context.getBean(TextMapPropagator.class);
|
|
|
|
TextMapPropagator propagator = context.getBean(TextMapPropagator.class);
|
|
|
|
Stream<Class<?>> injectors = getInjectors(propagator).stream().map(Object::getClass);
|
|
|
|
List<TextMapPropagator> injectors = getInjectors(propagator);
|
|
|
|
assertThat(injectors).containsExactly(W3CTraceContextPropagator.class);
|
|
|
|
assertThat(injectors).hasExactlyElementsOfTypes(W3CTraceContextPropagator.class);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|