-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Closed
Copy link
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
I had an issue during the migration of a project from Spring Boot version 3.1.5 to 3.2.0.
In 3.1.5 the Spring boot test suite was providing a "default" tracer. I was not able to find the configuration who was adding this tracer. (May be this one ?
Line 108 in 07d8c99
private void registerNoopTracer(ConfigurableApplicationContext context) { |
In Spring Boot 3.2.0, no default Tracer is configured. Is this a regression or a wanted behavior ? Maybe this change need to be documented if it's a wanted behavior ?
I've fixed my project by adding an tracer implementation (micrometer-tracing-bridge-otel in my case) and by migrating from the @WebMvcTest
annotation to the @SpringBootTest
annotation + @AutoConfigureMockMvc
annotation
DuncanCasteleyn
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Type
Projects
Relationships
Development
Select code repository
Activity
wilkinsona commentedon Nov 27, 2023
Thanks for the report. This change in behavior is a side-effect of #35354. For what were you using the
Tracer
API in a@WebMvcTest
? It may be that we need to refine the auto-configurations that are included in the@WebMvcTest
slice.wyfrel commentedon Nov 28, 2023
Hello Wilkinsona, i'm testing the behavior of an "Exception Handler" of my Rest service. I'm adding the trace information (traceId / SpanId ) of the request in the Response during the exception handling
DuncanCasteleyn commentedon Nov 30, 2023
We are also running into this problem, we rely on tracer to be present during tests, our tests fail since Spring Boot 3.2.0
wilkinsona commentedon Dec 6, 2023
We discussed this today. We think we may be able to modify
@AutoConfigureObservability
so that it can be used to opt into the auto-configuration of tracing and metrics in a sliced-test that otherwise would not have aTracer
orMeterRegistry
available.Add auto-configuration for a no-op tracer
mhalbritter commentedon Dec 12, 2023
@AutoConfigureObservability
can now be applied to sliced tests. If done so, it will auto-configure an in-memoryMeterRegistry
, a no-opTracer
and anObservationRegistry
.Another thing I've changed: if Micrometer Tracing is on the classpath, there's now always a
Tracer
in the context (for symmetry withMeterRegistry
andObservationRegistry
, which are always available, too). If neither Brave nor Otel supplies aTracer
, a no-op tracer is auto-configured.Auto-configure observatibility beans in sliced tests