-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@AutoConfigureObservability has unintentional consequences on integration tests #35354
Comments
I remember I wanted to mention this earlier but both |
There is another (accidental) side effect we observed through this: What would be the negative impact of enabling |
Goal: Remove the minimal amount of beans to prevent span reporting. Zipkin and BraveOnly the Another option would be to replace Another option would be to replace Zipkin and OTelOnly the Another option would be to replace Wavefront and BraveIf we only disable the Problem with that is that the We should disable Wavefront and OTelIf we only disable the See "Wavefront and Brave section" for more details. OTLP and OTelOnly the |
If integration tests are run, tracing by default is disabled. You can enable it again with
This is the minimal amount of beans we can remove so that integration tests don't send spans to backends. It leaves the rest of the tracing infrastructure (Micrometer Tracing, Brave, OpenTelemetry) untouched. If you have your own Brave |
By default, metrics and tracing are disabled in
@SpringBootTest
integration tests. While theMeterRegistry
gets replaced by aSimpleMeterRegistry
which collects the metrics in-memory, we replace the Micrometer TracingTracer
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 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.
The text was updated successfully, but these errors were encountered: