|
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;
|
@@ -64,9 +64,9 @@ static class OpenTelemetrySdkConfig {
|
64 | 64 |
|
65 | 65 | @Bean
|
66 | 66 | @ConfigurationPropertiesBinding
|
67 |
| - public MapConverter mapConverter() { |
| 67 | + public OtelMapConverter otelMapConverter() { |
68 | 68 | // needed for otlp exporter headers and OtelResourceProperties
|
69 |
| - return new MapConverter(); |
| 69 | + return new OtelMapConverter(); |
70 | 70 | }
|
71 | 71 |
|
72 | 72 | @Bean
|
@@ -133,6 +133,17 @@ public ConfigProperties otelProperties(
|
133 | 133 | @ConditionalOnProperty(name = "otel.sdk.disabled", havingValue = "true")
|
134 | 134 | static class DisabledOpenTelemetrySdkConfig {
|
135 | 135 |
|
| 136 | + @Bean |
| 137 | + @ConfigurationPropertiesBinding |
| 138 | + // Duplicated in OpenTelemetrySdkConfig and DisabledOpenTelemetrySdkConfig to not expose the |
| 139 | + // converter in the public API |
| 140 | + public OtelMapConverter otelMapConverter() { |
| 141 | + // needed for otlp exporter headers and OtelResourceProperties |
| 142 | + // we need this converter, even if the SDK is disabled, |
| 143 | + // because the properties are parsed before the SDK is disabled |
| 144 | + return new OtelMapConverter(); |
| 145 | + } |
| 146 | + |
136 | 147 | @Bean
|
137 | 148 | public OpenTelemetry openTelemetry() {
|
138 | 149 | return OpenTelemetry.noop();
|
|
0 commit comments