By default, metrics and tracing are disabled in @SpringBootTest integration tests. While the MeterRegistry gets replaced by a SimpleMeterRegistry which collects the metrics in-memory, we replace the Micrometer Tracing Tracer with a noop implementation.
There are other beans which are @ConditionalOnEnabledTracing, and those don't get created when running in a integration test. If users happen to have code using these beans they observe that the application is running fine when starting main, but fail with a missing bean when running the @SpringBootTest. This is strange behavior and we should think about if we want to behave this way.
We initially designed it that way so that integration tests don't send metrics / traces to monitoring systems. Ideally we would replace such beans with in memory implementations, but I don't think this is feasible for all affected beans.
By default, metrics and tracing are disabled in
@SpringBootTestintegration tests. While theMeterRegistrygets replaced by aSimpleMeterRegistrywhich collects the metrics in-memory, we replace the Micrometer TracingTracerwith a noop implementation.There are other beans which are
@ConditionalOnEnabledTracing, and those don't get created when running in a integration test. If users happen to have code using these beans they observe that the application is running fine when startingmain, but fail with a missing bean when running the@SpringBootTest. This is strange behavior and we should think about if we want to behave this way.We initially designed it that way so that integration tests don't send metrics / traces to monitoring systems. Ideally we would replace such beans with in memory implementations, but I don't think this is feasible for all affected beans.