|
7 | 7 |
|
8 | 8 | import io.opentelemetry.api.OpenTelemetry; |
9 | 9 | import io.opentelemetry.api.trace.TracerProvider; |
| 10 | +import io.opentelemetry.instrumentation.api.internal.EmbeddedInstrumentationProperties; |
10 | 11 | import io.opentelemetry.instrumentation.spring.autoconfigure.internal.OtelMapConverter; |
11 | 12 | import io.opentelemetry.instrumentation.spring.autoconfigure.internal.SdkEnabled; |
12 | 13 | import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelResourceProperties; |
|
28 | 29 | import java.util.function.Function; |
29 | 30 | import java.util.function.Supplier; |
30 | 31 | import java.util.stream.Collectors; |
| 32 | +import org.slf4j.Logger; |
| 33 | +import org.slf4j.LoggerFactory; |
31 | 34 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; |
32 | 35 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
33 | 36 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
54 | 57 | OtelSpringProperties.class |
55 | 58 | }) |
56 | 59 | public class OpenTelemetryAutoConfiguration { |
| 60 | + private static final Logger logger = |
| 61 | + LoggerFactory.getLogger(OpenTelemetryAutoConfiguration.class); |
57 | 62 |
|
58 | 63 | public OpenTelemetryAutoConfiguration() {} |
59 | 64 |
|
@@ -110,6 +115,11 @@ public AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk( |
110 | 115 | @Bean |
111 | 116 | public OpenTelemetry openTelemetry( |
112 | 117 | AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) { |
| 118 | + logger.info( |
| 119 | + "OpenTelemetry Spring Boot starter ({}) has been started", |
| 120 | + EmbeddedInstrumentationProperties.findVersion( |
| 121 | + "io.opentelemetry.spring-boot-autoconfigure")); |
| 122 | + |
113 | 123 | return autoConfiguredOpenTelemetrySdk.getOpenTelemetrySdk(); |
114 | 124 | } |
115 | 125 |
|
@@ -146,6 +156,8 @@ public OtelMapConverter otelMapConverter() { |
146 | 156 |
|
147 | 157 | @Bean |
148 | 158 | public OpenTelemetry openTelemetry() { |
| 159 | + logger.info("OpenTelemetry Spring Boot starter has been disabled"); |
| 160 | + |
149 | 161 | return OpenTelemetry.noop(); |
150 | 162 | } |
151 | 163 |
|
|
0 commit comments