Skip to content

Commit 97b4915

Browse files
committed
avoid api change
1 parent 37aaf9c commit 97b4915

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.13.0-SNAPSHOT.jar against opentelemetry-spring-boot-autoconfigure-2.12.0.jar
2-
*** MODIFIED CLASS: PUBLIC io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration (not serializable)
3-
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
4-
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.instrumentation.spring.autoconfigure.internal.MapConverter mapConverter()
5-
+++ NEW ANNOTATION: org.springframework.boot.context.properties.ConfigurationPropertiesBinding
6-
+++ NEW ANNOTATION: org.springframework.context.annotation.Bean
2+
No changes.

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java

+17-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import io.opentelemetry.api.OpenTelemetry;
99
import io.opentelemetry.api.trace.TracerProvider;
10-
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.MapConverter;
10+
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.OTelMapConverter;
1111
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.SdkEnabled;
1212
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelResourceProperties;
1313
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelSpringProperties;
@@ -57,20 +57,18 @@ public class OpenTelemetryAutoConfiguration {
5757

5858
public OpenTelemetryAutoConfiguration() {}
5959

60-
@Bean
61-
@ConfigurationPropertiesBinding
62-
public MapConverter mapConverter() {
63-
// needed for otlp exporter headers and OtelResourceProperties
64-
// we need this converter, even if the SDK is disabled,
65-
// because the properties are parsed before the SDK is disabled
66-
return new MapConverter();
67-
}
68-
6960
@Configuration
7061
@Conditional(SdkEnabled.class)
7162
@ConditionalOnMissingBean(OpenTelemetry.class)
7263
static class OpenTelemetrySdkConfig {
7364

65+
@Bean
66+
@ConfigurationPropertiesBinding
67+
public OTelMapConverter oTelMapConverter() {
68+
// needed for otlp exporter headers and OtelResourceProperties
69+
return new OTelMapConverter();
70+
}
71+
7472
@Bean
7573
public OpenTelemetrySdkComponentLoader openTelemetrySdkComponentLoader(
7674
ApplicationContext applicationContext) {
@@ -135,6 +133,15 @@ public ConfigProperties otelProperties(
135133
@ConditionalOnProperty(name = "otel.sdk.disabled", havingValue = "true")
136134
static class DisabledOpenTelemetrySdkConfig {
137135

136+
@Bean
137+
@ConfigurationPropertiesBinding
138+
public OTelMapConverter oTelMapConverter() {
139+
// needed for otlp exporter headers and OtelResourceProperties
140+
// we need this converter, even if the SDK is disabled,
141+
// because the properties are parsed before the SDK is disabled
142+
return new OTelMapConverter();
143+
}
144+
138145
@Bean
139146
public OpenTelemetry openTelemetry() {
140147
return OpenTelemetry.noop();
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
2121
* at any time.
2222
*/
23-
public class MapConverter implements Converter<String, Map<String, String>> {
23+
public class OTelMapConverter implements Converter<String, Map<String, String>> {
2424

2525
public static final String KEY = "key";
2626

0 commit comments

Comments
 (0)