Class TestObservationRegistry.TestObservationRegistryBuilder

java.lang.Object
io.micrometer.observation.tck.TestObservationRegistry.TestObservationRegistryBuilder
Enclosing class:
TestObservationRegistry

public static class TestObservationRegistry.TestObservationRegistryBuilder extends Object
Builder to create TestObservationRegistry.
Since:
1.16.0
  • Constructor Details

    • TestObservationRegistryBuilder

      public TestObservationRegistryBuilder()
  • Method Details

    • validateObservationsWithTheSameNameHavingTheSameSetOfLowCardinalityKeys

      public TestObservationRegistry.TestObservationRegistryBuilder validateObservationsWithTheSameNameHavingTheSameSetOfLowCardinalityKeys(boolean flag)
      Enables/disables validating that Observations with the same name should have the same set of low cardinality keys.

      Example 1:

       observation{name=test, lowCardinalityKeyValues=[color=red]}
       observation{name=test, lowCardinalityKeyValues=[color=green]}
       observation{name=test, lowCardinalityKeyValues=[color=blue]}
       

      Example 1 is valid since all the observations with the same name ("test") has the same set of low cardinality keys ("color").

      Example 2:

       observation{name=test, lowCardinalityKeyValues=[color=red]}
       observation{name=test, lowCardinalityKeyValues=[]}
       observation{name=test, lowCardinalityKeyValues=[status=ok]}
       

      Example 2 is invalid since the second observation is missing a key the first one has ("color") and the third observation is not only missing a key the first one has ("color") but it also has an extra key the first one does not have ("status").

    • build

      public TestObservationRegistry build()