mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:00:13 +08:00
Clarify which tracing components are disabled when using tracing in tests
See gh-33975
This commit is contained in:
parent
328261337e
commit
d6f67b02f7
@ -202,5 +202,5 @@ For the example above, setting this property to `baggage1` results in an MDC ent
|
|||||||
[[actuator.micrometer-tracing.tests]]
|
[[actuator.micrometer-tracing.tests]]
|
||||||
=== Tests
|
=== Tests
|
||||||
|
|
||||||
Tracing is not auto-configured when using `@SpringBootTest`.
|
Tracing components which are reporting data are not auto-configured when using `@SpringBootTest`.
|
||||||
See <<features#features.testing.spring-boot-applications.tracing, the testing section>> for more details.
|
See <<features#features.testing.spring-boot-applications.tracing, the testing section>> for more details.
|
||||||
|
@ -266,9 +266,11 @@ If you need to export metrics to a different backend as part of an integration t
|
|||||||
|
|
||||||
[[features.testing.spring-boot-applications.tracing]]
|
[[features.testing.spring-boot-applications.tracing]]
|
||||||
==== Using Tracing
|
==== Using Tracing
|
||||||
Regardless of your classpath, tracing is not auto-configured when using `@SpringBootTest`.
|
Regardless of your classpath, tracing components which are reporting data are not auto-configured when using `@SpringBootTest`.
|
||||||
|
|
||||||
If you need tracing as part of an integration test, annotate it with `@AutoConfigureObservability`.
|
If you need those components as part of an integration test, annotate the test with `@AutoConfigureObservability`.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user