Class SpanName (2.76.0)

public abstract class SpanName

A value class to represent the name of the operation in an ApiTracer.

Inheritance

java.lang.Object > SpanName

Static Methods

of(ApiTracerContext apiTracerContext)

public static SpanName of(ApiTracerContext apiTracerContext)

Returns a new SpanName parsed from the given ApiTracerContext

This is extracted from ApiTracerContext#fullMethodName() using the #FULL_METHOD_NAME_REGEX

  • If fullMethodName() is "google.pubsub.v1.Publisher/Publish", the client name is "Publisher".
  • If fullMethodName() is "google.pubsub.v1.Publisher/Publish", the base method name is "Publish".
Parameter
Name Description
apiTracerContext ApiTracerContext
Returns
Type Description
SpanName

a new SpanName with the parsed client name and method name

of(String clientName, String methodName)

public static SpanName of(String clientName, String methodName)

Creates a new instance of the name.

Parameters
Name Description
clientName String

The name of the client. In general this will be GAPIC generated client name. However, in some cases, when the GAPIC generated client is wrapped, this will be overridden to specify the manually written wrapper's name.

methodName String

The name of the logical operation being traced.

Returns
Type Description
SpanName

Constructors

SpanName()

public SpanName()

Methods

getClientName()

public abstract String getClientName()

The name of the client. ie BigtableData

Returns
Type Description
String

getMethodName()

public abstract String getMethodName()

The name of the logical operation being traced. ie. ReadRows.

Returns
Type Description
String

toString()

public String toString()
Returns
Type Description
String
Overrides