Package brave.grpc
Class GrpcParser
java.lang.Object
brave.grpc.GrpcParser
- Direct Known Subclasses:
GrpcClientParser
,GrpcServerParser
public class GrpcParser extends Object
-
Constructor Summary
Constructors Constructor Description GrpcParser()
-
Method Summary
Modifier and Type Method Description protected ErrorParser
errorParser()
Override when making custom types.protected void
onClose(io.grpc.Status status, io.grpc.Metadata trailers, SpanCustomizer span)
Override to change what data from the status or trailers are parsed into the span modeling it.protected <M> void
onMessageReceived(M message, SpanCustomizer span)
Override to customize the span based on the message received from the peer.protected <M> void
onMessageSent(M message, SpanCustomizer span)
Override to customize the span based on a message sent to the peer.protected <ReqT, RespT>
StringspanName(io.grpc.MethodDescriptor<ReqT,RespT> methodDescriptor)
Returns the span name of the request.
-
Constructor Details
-
GrpcParser
public GrpcParser()
-
-
Method Details
-
errorParser
Override when making custom types. Typically, you'll useTracing.errorParser()
{@code class MyGrpcParser extends GrpcParser { ErrorParser errorParser; MyGrpcParser(Tracing tracing) { errorParser = tracing.errorParser(); } protected ErrorParser errorParser() { return errorParser; } --snip-- }
-
spanName
Returns the span name of the request. Defaults to the full grpc method name. -
onMessageSent
Override to customize the span based on a message sent to the peer. -
onMessageReceived
Override to customize the span based on the message received from the peer. -
onClose
Override to change what data from the status or trailers are parsed into the span modeling it. By default, this tags "grpc.status_code" and "error" when it is not OK.
-