Package brave.rpc

Interface RpcResponseParser

  • All Known Implementing Classes:
    RpcResponseParser.Default

    public interface RpcResponseParser
    Use this to control the response data recorded for an sampled RPC client or server span.

    Here's an example that adds default tags, and if gRPC, the response encoding:

    {@code
     Tag responseEncoding = new Tag("grpc.response_encoding") {
    Since:
    5.12
    See Also:
    RpcRequestParser
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void parse​(RpcResponse response, brave.propagation.TraceContext context, brave.SpanCustomizer span)
      Implement to choose what data from the RPC response are parsed into the span representing it.
    • Method Detail

      • parse

        void parse​(RpcResponse response,
                   brave.propagation.TraceContext context,
                   brave.SpanCustomizer span)
        Implement to choose what data from the RPC response are parsed into the span representing it.

        Note: This is called after Span.error(Throwable), which means any "error" tag set here will overwrite what the error parser set.

        Since:
        5.12
        See Also:
        RpcResponseParser.Default