Top Description Constructors Methods
io.micrometer.tracing.internal

public Class DefaultSpanNamer

extends Object
implements SpanNamer
Class Inheritance
All Implemented Interfaces
io.micrometer.tracing.SpanNamer
Imports
java.lang.reflect.Method, io.micrometer.tracing.SpanName, .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.

Author
Marcin Grzejszczak
Since
1.0.0
See Also
SpanName

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private SpanName
private static boolean
isDefaultToString(Object delegate, String spanName)

public String
name(Object
- object for which span name should be picked
object
,
String
- the default valued to be returned if span name can't be calculated
defaultValue
)

Implements io.micrometer.tracing.SpanNamer.name.

Retrieves the span name for the given object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultSpanNamerback to summary
public DefaultSpanNamer()

Method Detail

annotationback to summary
private SpanName annotation(Object o)
isDefaultToStringback to summary
private static boolean isDefaultToString(Object delegate, String spanName)
nameback to summary
public String name(Object object, String defaultValue)

Implements io.micrometer.tracing.SpanNamer.name.

Doc from io.micrometer.tracing.SpanNamer.name.

Retrieves the span name for the given object.

Parameters
object:Object

- object for which span name should be picked

defaultValue:String

- the default valued to be returned if span name can't be calculated

Returns:String

span name

Annotations
@Override