diff --git a/azure-application-insights-spring-boot-starter/src/main/java/com/microsoft/applicationinsights/autoconfigure/ApplicationInsightsTelemetryAutoConfiguration.java b/azure-application-insights-spring-boot-starter/src/main/java/com/microsoft/applicationinsights/autoconfigure/ApplicationInsightsTelemetryAutoConfiguration.java index 9e68c559bba..fa70b1e6ce6 100644 --- a/azure-application-insights-spring-boot-starter/src/main/java/com/microsoft/applicationinsights/autoconfigure/ApplicationInsightsTelemetryAutoConfiguration.java +++ b/azure-application-insights-spring-boot-starter/src/main/java/com/microsoft/applicationinsights/autoconfigure/ApplicationInsightsTelemetryAutoConfiguration.java @@ -147,6 +147,7 @@ public TelemetryConfiguration telemetryConfiguration() { if (telemetryProcessors != null) { telemetryConfiguration.getTelemetryProcessors().addAll(telemetryProcessors); } + initializeTelemetryChannel(telemetryConfiguration); initializeComponents(telemetryConfiguration); initializePerformanceCounterContainer(); return telemetryConfiguration; @@ -173,9 +174,7 @@ public TelemetryClient telemetryClient(TelemetryConfiguration configuration) { - @Bean - @ConditionalOnMissingBean - public TelemetryChannel telemetryChannel(TelemetryConfiguration configuration) { + private void initializeTelemetryChannel(TelemetryConfiguration configuration) { InProcess inProcess = applicationInsightsProperties.getChannel().getInProcess(); final InProcessTelemetryChannel channel; if (StringUtils.isNotEmpty(inProcess.getEndpointAddress())) { @@ -189,7 +188,6 @@ public TelemetryChannel telemetryChannel(TelemetryConfiguration configuration) { } configuration.setChannel(channel); - return channel; } @Bean