The introduction of ObservabilityContextCustomizerFactory and @AutoConfigureObservability is breaking smoke/integration tests that were relying on certain beans to exists. Basically any auto-configuration that uses @ConditionalOnEnabledTracing when creating beans will be missed in the test context. The purpose of this issue is to request that this disabling metric/tracing functionality be controlled by a property.

CC: @jonatan-ivanov

Comment From: philwebb

We discussed this on today's team call and we think we should consider it a bug that there's no way to opt-out of the customizer without an annotation.

We think one way to fix this would be to change DisableObservabilityContextCustomizer so that if there's no annotation it looks for a property. We have some existing testing properties, so it seems reasonable to add more.

Perhaps spring.test.observability.auto-configure where true is the same as @AutoConfigureObservability(true, true) and false is the same as @AutoConfigureObservability(false, false). If an annotation is on the test then it takes precedence.