Annotation 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 Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether metrics should be reported to external systems in the test.
    boolean
    Whether meter registries should be added to Micrometer's global registry in the test.
  • Element Details

    • export

      boolean export
      Whether 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 useGlobalRegistry
      Whether meter registries should be added to Micrometer's global registry in the test. If management.metrics.use-global-registry has 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