Class DefaultSpanNamer

java.lang.Object
io.micrometer.tracing.internal.DefaultSpanNamer
All Implemented Interfaces:
SpanNamer

public class DefaultSpanNamer extends Object implements SpanNamer
Default implementation of SpanNamer that tries to get the span name as follows:

* from the @SpanName annotation on the class if one is present.

* from the @SpanName annotation on the method if passed object is of a Method. type

* from the toString() of the delegate if it's not the default Object.toString().

* the default provided value.

Since:
1.0.0
See Also:
  • Constructor Details

    • DefaultSpanNamer

      public DefaultSpanNamer()
  • Method Details

    • name

      public String name(Object object, String defaultValue)
      Description copied from interface: SpanNamer
      Retrieves the span name for the given object.
      Specified by:
      name in interface SpanNamer
      Parameters:
      object - - object for which span name should be picked
      defaultValue - - the default valued to be returned if span name can't be calculated
      Returns:
      span name