Annotation Interface AutoConfigureMetrics
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Inherited
@ImportAutoConfiguration
public @interface AutoConfigureMetrics
Annotation that can be applied to a test class to enable auto-configuration for
metrics.
If this annotation is applied to a sliced test, an in-memory MeterRegistry and
an ObservationRegistry are added to the application context.
- Since:
- 4.0.0
- Author:
- Moritz Halbritter, Lordwill Kandiro
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether metrics should be reported to external systems in the test.booleanWhethermeter registriesshould be added to Micrometer'sglobal registryin the test.
-
Element Details
-
export
boolean exportWhether metrics should be reported to external systems in the test.- Returns:
- whether metrics should be reported to external systems in the test
- Default:
true
-
useGlobalRegistry
boolean useGlobalRegistryWhethermeter registriesshould be added to Micrometer'sglobal registryin the test. Ifmanagement.metrics.use-global-registryhas been set explicitly, its value is used and this attribute has no effect.- Returns:
- whether the global registry should be used in the test
- Since:
- 4.2.0
- Default:
false
-