Skip to content

Commit 118d244

Browse files
committed
ref(samples): [Queue Instrumentation 19] Drop Kafka auto-config exclude from Spring Boot samples
Remove `spring.autoconfigure.exclude=KafkaAutoConfiguration` from the default `application.properties` and the matching empty override from `application-kafka.properties` in the three Spring Boot Jakarta samples. `spring.autoconfigure.exclude` is a single list property, so overriding it in a profile replaces the whole list rather than merging. Adding a sibling `rabbitmq` profile with the same pattern would not compose — activating one profile would unsilence the other's auto-config. The `@Profile("kafka")` annotations already on `KafkaConsumer` and `KafkaController` gate the actual listener container and endpoint, so no broker connection is attempted when the profile is inactive. `KafkaAutoConfiguration` still runs and creates an unused `KafkaTemplate` bean in that case, which is harmless. Sentry's own Kafka auto-config remains gated on `sentry.enable-queue-tracing=true`, which is only set in `application-kafka.properties`, so Sentry instrumentation behavior is unchanged.
1 parent 1af29a3 commit 118d244

6 files changed

Lines changed: 0 additions & 12 deletions

File tree

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src/main/resources/application-kafka.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Kafka — activate with: --spring.profiles.active=kafka
22
sentry.enable-queue-tracing=true
33

4-
spring.autoconfigure.exclude=
54
spring.kafka.bootstrap-servers=localhost:9092
65
spring.kafka.consumer.group-id=sentry-sample-group
76
spring.kafka.consumer.auto-offset-reset=earliest

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src/main/resources/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ spring.graphql.graphiql.enabled=true
3535
spring.graphql.websocket.path=/graphql
3636
spring.quartz.job-store-type=memory
3737

38-
# Kafka is only active with the 'kafka' profile (--spring.profiles.active=kafka)
39-
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
40-
4138
# Cache tracing
4239
sentry.enable-cache-tracing=true
4340
spring.cache.cache-names=todos

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/src/main/resources/application-kafka.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Kafka — activate with: --spring.profiles.active=kafka
22
sentry.enable-queue-tracing=true
33

4-
spring.autoconfigure.exclude=
54
spring.kafka.bootstrap-servers=localhost:9092
65
spring.kafka.consumer.group-id=sentry-sample-group
76
spring.kafka.consumer.auto-offset-reset=earliest

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/src/main/resources/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ spring.graphql.graphiql.enabled=true
3535
spring.graphql.websocket.path=/graphql
3636
spring.quartz.job-store-type=memory
3737

38-
# Kafka is only active with the 'kafka' profile (--spring.profiles.active=kafka)
39-
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
40-
4138
# Cache tracing
4239
sentry.enable-cache-tracing=true
4340
spring.cache.cache-names=todos

sentry-samples/sentry-samples-spring-boot-jakarta/src/main/resources/application-kafka.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Kafka — activate with: --spring.profiles.active=kafka
22
sentry.enable-queue-tracing=true
33

4-
spring.autoconfigure.exclude=
54
spring.kafka.bootstrap-servers=localhost:9092
65
spring.kafka.consumer.group-id=sentry-sample-group
76
spring.kafka.consumer.auto-offset-reset=earliest

sentry-samples/sentry-samples-spring-boot-jakarta/src/main/resources/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ spring.quartz.job-store-type=memory
3838
# Cache tracing
3939
sentry.enable-cache-tracing=true
4040

41-
# Kafka is only active with the 'kafka' profile (--spring.profiles.active=kafka)
42-
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
43-
4441
spring.cache.cache-names=todos
4542
spring.cache.caffeine.spec=maximumSize=500,expireAfterAccess=600s
4643

0 commit comments

Comments
 (0)