Interface RpcAttributesGetter<REQUEST,RESPONSE>
public interface RpcAttributesGetter<REQUEST,RESPONSE>
An interface for getting RPC attributes.
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the RpcClientAttributesExtractor or RpcServerAttributesExtractor to obtain the various RPC attributes in a type-generic way.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetErrorType(REQUEST request, RESPONSE response, Throwable error) Returns a description of a class of error the operation ended with.Deprecated.default LonggetRequestSize(REQUEST request) default LonggetResponseSize(REQUEST request) default StringgetRpcMethod(REQUEST request) Returns the fully-qualified RPC method name for stable semconv.default StringgetRpcMethodOriginal(REQUEST request) Returns the original method name when the method reported viagetRpcMethod(REQUEST)is set to_OTHERbecause the method is not recognized by the RPC framework.default StringgetRpcSystemName(REQUEST request) Returns the stable semconv system name for the RPC framework (e.g.getService(REQUEST request) Deprecated.
-
Method Details
-
getRpcSystemName
Returns the stable semconv system name for the RPC framework (e.g."grpc","java_rmi","dotnet_wcf").- See Also:
-
getSystem
Deprecated.UsegetRpcSystemName(REQUEST). To be removed in 3.0. -
getService
-
getMethod
Deprecated.UsegetRpcMethod(REQUEST)for stable semconv. -
getRequestSize
-
getResponseSize
-
getRpcMethod
Returns the fully-qualified RPC method name for stable semconv.- Parameters:
request- the request object- Returns:
- the fully-qualified RPC method name (e.g., "my.Service/Method"), or null if service or method is unavailable
-
getRpcMethodOriginal
Returns the original method name when the method reported viagetRpcMethod(REQUEST)is set to_OTHERbecause the method is not recognized by the RPC framework. -
getErrorType
@Nullable default String getErrorType(REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error) Returns a description of a class of error the operation ended with.This method should return
nullif there was no error.If this method returns
null, the exception class name will be used as error type if one was thrown.The cardinality of the error type should be low. The instrumentations implementing this method are recommended to document the custom values they support.
Examples:
CANCELLED,UNKNOWN,-32602
-
getRpcMethod(REQUEST)for stable semconv.