Add @AutoConfigureObservability annotation

This annotation is read by ObservabilityContextCustomizerFactory, which
then sets test properties depending on the annotation attributes.

@AutoConfigureMetrics is deprecated, to support backwards compatability
it's now meta-annotated with @AutoConfigureObservability

See gh-31308
This commit is contained in:
Moritz Halbritter
2022-06-10 11:36:55 +02:00
parent 36f01eb40b
commit b250d8a1e4
14 changed files with 453 additions and 149 deletions

View File

@@ -226,7 +226,7 @@ include::code:MyJmxTests[]
==== Using Metrics
Regardless of your classpath, meter registries, except the in-memory backed, are not auto-configured when using `@SpringBootTest`.
If you need to export metrics to a different backend as part of an integration test, annotate it with `@AutoConfigureMetrics`.
If you need to export metrics to a different backend as part of an integration test, annotate it with `@AutoConfigureObservability`.