Annotation Interface SpanTag


@Retention(RUNTIME) @Inherited @Target(PARAMETER) public @interface SpanTag
There are 3 different ways to add tags to a span. All of them are controlled by the annotation values. Precedence is:

try with the ValueResolver bean if the value of the bean wasn't set, try to evaluate a SPEL expression if there’s no SPEL expression just return a toString() value of the parameter

Since:
1.0.0
  • Optional Element Summary

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

    • value

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

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

      String expression
      Execute this expression to calculate the tag value. Will be analyzed if no value of the resolver() was set.
      Returns:
      an expression
      Default:
      ""
    • resolver

      Class<? extends io.micrometer.common.annotation.ValueResolver> resolver
      Use this bean to resolve the tag value. Has the highest precedence.
      Returns:
      ValueResolver bean
      Default:
      io.micrometer.common.annotation.NoOpValueResolver.class