|
7 | 7 |
|
8 | 8 | import io.opentelemetry.api.OpenTelemetry;
|
9 | 9 | import io.opentelemetry.api.trace.TracerProvider;
|
10 |
| -import io.opentelemetry.instrumentation.spring.autoconfigure.internal.MapConverter; |
| 10 | +import io.opentelemetry.instrumentation.spring.autoconfigure.internal.OTelMapConverter; |
11 | 11 | import io.opentelemetry.instrumentation.spring.autoconfigure.internal.SdkEnabled;
|
12 | 12 | import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelResourceProperties;
|
13 | 13 | import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelSpringProperties;
|
@@ -57,20 +57,18 @@ public class OpenTelemetryAutoConfiguration {
|
57 | 57 |
|
58 | 58 | public OpenTelemetryAutoConfiguration() {}
|
59 | 59 |
|
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 |
| - |
69 | 60 | @Configuration
|
70 | 61 | @Conditional(SdkEnabled.class)
|
71 | 62 | @ConditionalOnMissingBean(OpenTelemetry.class)
|
72 | 63 | static class OpenTelemetrySdkConfig {
|
73 | 64 |
|
| 65 | + @Bean |
| 66 | + @ConfigurationPropertiesBinding |
| 67 | + public OTelMapConverter oTelMapConverter() { |
| 68 | + // needed for otlp exporter headers and OtelResourceProperties |
| 69 | + return new OTelMapConverter(); |
| 70 | + } |
| 71 | + |
74 | 72 | @Bean
|
75 | 73 | public OpenTelemetrySdkComponentLoader openTelemetrySdkComponentLoader(
|
76 | 74 | ApplicationContext applicationContext) {
|
@@ -135,6 +133,15 @@ public ConfigProperties otelProperties(
|
135 | 133 | @ConditionalOnProperty(name = "otel.sdk.disabled", havingValue = "true")
|
136 | 134 | static class DisabledOpenTelemetrySdkConfig {
|
137 | 135 |
|
| 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 | + |
138 | 145 | @Bean
|
139 | 146 | public OpenTelemetry openTelemetry() {
|
140 | 147 | return OpenTelemetry.noop();
|
|
0 commit comments