Repository navigation
Spring Boot Tracing in Integration Tests
In Spring Boot 4.1, @SpringBootTest deliberately does not configure tracing components that report data. A test context can therefore provide a no-op Tracer, an empty propagator set, and SimpleObservationRegistry even when the application has the expected Micrometer Tracing and Brave runtime dependencies.
This is easy to misdiagnose as a missing dependency. A dependency tree cannot distinguish an absent runtime module from the test framework's deliberate no-op behavior.
Add @AutoConfigureTracing to an integration test that needs reporting tracing components:
import org.springframework.boot.micrometer.tracing.test.autoconfigure.AutoConfigureTracing;
@AutoConfigureTracingFor Spring Boot 4.1, the annotation is provided by the test-scope artifact org.springframework.boot:spring-boot-micrometer-tracing-test:4.1.0. In this project the artifact was not available transitively, so it was added directly in test scope. It is not a production dependency.
When an integration test sees a no-op span or fails to propagate headers:
- Check the test's tracer implementation, propagator beans, and observation registry.
- Read the Spring Boot test documentation before treating dependency output as causal evidence.
- Confirm the test uses the intended context rather than a narrower test slice.
- Add
@AutoConfigureTracingwhen the test needs reporting tracing components.
The application should still be checked for actual dependency and configuration errors, but those checks do not replace the framework-specific test configuration check.
This wiki documents NR Waste Plus for users and developers. Verify security and deployment guidance against the current application configuration before applying it elsewhere.
- Report an issue or ask a question in the GitHub repository.
- Follow the Contributing Guidelines to propose an update.
- Read the Code of Conduct.
Collection indexes support human browsing and machine retrieval. Keep both current when adding or moving wiki pages.
NR Waste Plus Wiki | GitHub Repository