-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDC auto-configuration for Brave and OpenTelemetry #32214
MDC auto-configuration for Brave and OpenTelemetry #32214
Conversation
9d4bba9
to
04f6e12
Compare
...java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryConfigurations.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java
Outdated
Show resolved
Hide resolved
spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle
Outdated
Show resolved
Hide resolved
9e9632f
to
e368abe
Compare
e368abe
to
337adc5
Compare
@@ -34,6 +35,7 @@ | |||
*/ | |||
@AutoConfiguration(before = MicrometerTracingAutoConfiguration.class) | |||
@Import({ SdkConfiguration.class, TracerConfiguration.class, MicrometerConfiguration.class }) | |||
@EnableConfigurationProperties(TracingProperties.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? It's duplicating the same from TracerConfiguration
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TracerConfiguration
doesn't have this. After this change it looks exactly the same way as BraveAutoConfiguration
looks like
...main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryConfigurations.java
Outdated
Show resolved
Hide resolved
...java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryConfigurations.java
Outdated
Show resolved
Hide resolved
...java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryConfigurations.java
Outdated
Show resolved
Hide resolved
...java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryConfigurations.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java
Show resolved
Hide resolved
...ain/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinProperties.java
Outdated
Show resolved
Hide resolved
...va/org/springframework/boot/actuate/autoconfigure/tracing/BaggageAutoConfigurationTests.java
Outdated
Show resolved
Hide resolved
...va/org/springframework/boot/actuate/autoconfigure/tracing/BaggageAutoConfigurationTests.java
Outdated
Show resolved
Hide resolved
@@ -99,6 +101,12 @@ void shouldBackOffOnCustomBeans() { | |||
}); | |||
} | |||
|
|||
@Configuration(proxyBeanMethods = false) | |||
@EnableConfigurationProperties(TracingProperties.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit unusual. Why is a user configuration class enabling one of our configuration properties classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because Moritz has created a test for a subconfiguration only that now requires the TracingProperties and those are enabled in a higher order configuration.
Sorry, looks like GitHub has double-posted my latest review comments. |
f7e165a
to
a17cdf2
Compare
Since we used the Context class for Brave tests too (assertThat(Context.current()).isEqualTo(Context.root());) the Context class was loaded during Brave tests which triggered the static initialization of the ContextStorage. At that point since the OTel beans were not created and the ContextStorage wrapper was not registered, OTel defaults were used instead of ours
a17cdf2
to
ce1d351
Compare
closing in favour of #32480 |
A sample with a test that proves that things are working fine mdc-observability.zip