Annotation Interface ObservationKeyValue


There are 3 different ways to add key-values to an observation. All of them are controlled by the annotation values. Precedence is to first try with the ValueResolver. If the value of the resolver wasn't set, try to evaluate an expression. If there's no expression just return a toString() value of the parameter. Cardinality also can be set by cardinality(). default value is Cardinality.HIGH.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Cardinality of the key-value.
    Execute this expression to calculate the key-value value.
    The name of the key of the key-value which should be created.
    Class<? extends io.micrometer.common.annotation.ValueResolver>
    Use this object to resolve the key-value value.
    The name of the key of the key-value which should be created.
  • Element Details

    • value

      String value
      The name of the key of the key-value which should be created. This is an alias for key().
      Returns:
      the key-value key name
      Default:
      ""
    • key

      String key
      The name of the key of the key-value which should be created.
      Returns:
      the key-value key name
      Default:
      ""
    • expression

      String expression
      Execute this expression to calculate the key-value value. Will be evaluated if no value of the resolver() was set. You need to have a ValueExpressionResolver registered on the ObservationKeyValueAnnotationHandler to provide the expression resolution engine.
      Returns:
      an expression
      Default:
      ""
    • resolver

      Class<? extends io.micrometer.common.annotation.ValueResolver> resolver
      Use this object to resolve the key-value value. Has the highest precedence.
      Returns:
      ValueResolver class
      Default:
      io.micrometer.common.annotation.NoOpValueResolver.class
    • cardinality

      Cardinality cardinality
      Cardinality of the key-value.
      Returns:
      Cardinality class
      Default:
      HIGH