Skip to content

Commit d6f67b0

Browse files
committed
Clarify which tracing components are disabled when using tracing in tests
See gh-33975
1 parent 3282613 commit d6f67b0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,5 @@ For the example above, setting this property to `baggage1` results in an MDC ent
202202
[[actuator.micrometer-tracing.tests]]
203203
=== Tests
204204

205-
Tracing is not auto-configured when using `@SpringBootTest`.
205+
Tracing components which are reporting data are not auto-configured when using `@SpringBootTest`.
206206
See <<features#features.testing.spring-boot-applications.tracing, the testing section>> for more details.

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,11 @@ If you need to export metrics to a different backend as part of an integration t
266266

267267
[[features.testing.spring-boot-applications.tracing]]
268268
==== Using Tracing
269-
Regardless of your classpath, tracing is not auto-configured when using `@SpringBootTest`.
269+
Regardless of your classpath, tracing components which are reporting data are not auto-configured when using `@SpringBootTest`.
270270

271-
If you need tracing as part of an integration test, annotate it with `@AutoConfigureObservability`.
271+
If you need those components as part of an integration test, annotate the test with `@AutoConfigureObservability`.
272+
273+
If you have created your own reporting components (e.g. a custom `SpanExporter` or `SpanHandler`) and you don't want them to be active in tests, you can use the `@ConditionalOnEnabledTracing` annotation to disable them.
272274

273275

274276

0 commit comments

Comments
 (0)