com.sitewhere.grpc.client.common.tracing.OperationNameConstructor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sitewhere-grpc-client Show documentation
Show all versions of sitewhere-grpc-client Show documentation
SiteWhere gRPC Client Components
package com.sitewhere.grpc.client.common.tracing;
import io.grpc.MethodDescriptor;
/**
* Interface that allows span operation names to be constructed from an RPC's
* method descriptor.
*/
public interface OperationNameConstructor {
/**
* Default span operation name constructor, that will return an RPC's method
* name when constructOperationName is called.
*/
public static OperationNameConstructor DEFAULT = new OperationNameConstructor() {
@Override
public String constructOperationName(MethodDescriptor method) {
return method.getFullMethodName();
}
};
/**
* Constructs a span's operation name from the RPC's method.
*
* @param method
* the rpc method to extract a name from
* @param
* the rpc request type
* @param
* the rpc response type
* @return the operation name
*/
public String constructOperationName(MethodDescriptor method);
}