Package io.grpc.util

Class ForwardingClientStreamTracer

    • Constructor Detail

      • ForwardingClientStreamTracer

        public ForwardingClientStreamTracer()
    • Method Detail

      • delegate

        protected abstract ClientStreamTracer delegate()
        Returns the underlying ClientStreamTracer.
      • streamCreated

        public void streamCreated​(Attributes transportAttrs,
                                  Metadata headers)
        Description copied from class: ClientStreamTracer
        The stream is being created on a ready transport.
        Overrides:
        streamCreated in class ClientStreamTracer
        headers - the mutable initial metadata. Modifications to it will be sent to the socket but not be seen by client interceptors and the application.
      • createPendingStream

        public void createPendingStream()
        Description copied from class: ClientStreamTracer
        Name resolution is completed and the connection starts getting established. This method is only invoked on the streams that encounter such delay.

        gRPC buffers the client call if the remote address and configurations, e.g. timeouts and retry policy, are not ready. Asynchronously gRPC internally does the name resolution to get this information. The streams that are processed immediately on ready transports by the time the RPC comes do not go through the pending process, thus this callback will not be invoked.
        Overrides:
        createPendingStream in class ClientStreamTracer
      • recordAttemptDelayStart

        public void recordAttemptDelayStart​(String delayType,
                                            String delayReason)
        Description copied from class: ClientStreamTracer
        Called when an attempt-level delay segment (such as waiting for a load balancing pick or connection establishment) starts.

        This method is invoked synchronously on the attempt thread. Implementations should start internal timers or child tracing spans (named strictly "Attempt Delay") carrying the canonical grpc.delay_type attribute.

        Overrides:
        recordAttemptDelayStart in class ClientStreamTracer
        Parameters:
        delayType - canonical low-cardinality label categorizing the delay (e.g., "connecting")
        delayReason - high-cardinality diagnostic string describing granular runtime conditions
      • recordAttemptDelayReasonChanged

        public void recordAttemptDelayReasonChanged​(String delayReason)
        Description copied from class: ClientStreamTracer
        Called when an attempt-level delay reason changes while the overall delay type remains constant (for example, when a priority load balancing policy fails over between tiers).

        Implementations should record structured events (such as "Delay state transition") on the active delay span without recreating the span or resetting cumulative timers.

        Overrides:
        recordAttemptDelayReasonChanged in class ClientStreamTracer
        Parameters:
        delayReason - updated high-cardinality diagnostic string describing new conditions
      • recordAttemptDelayEnd

        public void recordAttemptDelayEnd()
        Description copied from class: ClientStreamTracer
        Called when an attempt-level delay segment ends upon successful pick or stream creation.

        Implementations should simultaneously close active child tracing spans and record elapsed duration to the grpc.client.attempt.delay.duration histogram.

        Overrides:
        recordAttemptDelayEnd in class ClientStreamTracer
      • inboundHeaders

        public void inboundHeaders​(Metadata headers)
        Description copied from class: ClientStreamTracer
        Headers has been received from the server. This method does not pass ownership to headers, so implementations must not access the metadata after returning. Modifications to the metadata within this method will be seen by interceptors and the application.
        Overrides:
        inboundHeaders in class ClientStreamTracer
        Parameters:
        headers - the received header metadata
      • inboundTrailers

        public void inboundTrailers​(Metadata trailers)
        Description copied from class: ClientStreamTracer
        Trailing metadata has been received from the server. This method does not pass ownership to trailers, so implementations must not access the metadata after returning. Modifications to the metadata within this method will be seen by interceptors and the application.
        Overrides:
        inboundTrailers in class ClientStreamTracer
        Parameters:
        trailers - the received trailing metadata
      • outboundMessage

        public void outboundMessage​(int seqNo)
        Description copied from class: StreamTracer
        An outbound message has been passed to the stream. This is called as soon as the stream knows about the message, but doesn't have further guarantee such as whether the message is serialized or not.
        Overrides:
        outboundMessage in class StreamTracer
        Parameters:
        seqNo - the sequential number of the message within the stream, starting from 0. It can be used to correlate with StreamTracer.outboundMessageSent(int, long, long) for the same message.
      • inboundMessage

        public void inboundMessage​(int seqNo)
        Description copied from class: StreamTracer
        An inbound message has been received by the stream. This is called as soon as the stream knows about the message, but doesn't have further guarantee such as whether the message is deserialized or not.
        Overrides:
        inboundMessage in class StreamTracer
        Parameters:
        seqNo - the sequential number of the message within the stream, starting from 0. It can be used to correlate with StreamTracer.inboundMessageRead(int, long, long) for the same message.
      • outboundMessageSent

        public void outboundMessageSent​(int seqNo,
                                        long optionalWireSize,
                                        long optionalUncompressedSize)
        Description copied from class: StreamTracer
        An outbound message has been serialized and sent to the transport.
        Overrides:
        outboundMessageSent in class StreamTracer
        Parameters:
        seqNo - the sequential number of the message within the stream, starting from 0. It can be used to correlate with StreamTracer.outboundMessage(int) for the same message.
        optionalWireSize - the wire size of the message. -1 if unknown
        optionalUncompressedSize - the uncompressed serialized size of the message. -1 if unknown
      • inboundMessageRead

        public void inboundMessageRead​(int seqNo,
                                       long optionalWireSize,
                                       long optionalUncompressedSize)
        Description copied from class: StreamTracer
        An inbound message has been fully read from the transport.
        Overrides:
        inboundMessageRead in class StreamTracer
        Parameters:
        seqNo - the sequential number of the message within the stream, starting from 0. It can be used to correlate with StreamTracer.inboundMessage(int) for the same message.
        optionalWireSize - the wire size of the message. -1 if unknown
        optionalUncompressedSize - the uncompressed serialized size of the message. -1 if unknown
      • outboundWireSize

        public void outboundWireSize​(long bytes)
        Description copied from class: StreamTracer
        The wire size of some outbound data is revealed. This can only used to record the accumulative outbound wire size. There is no guarantee wrt timing or granularity of this method.
        Overrides:
        outboundWireSize in class StreamTracer
      • outboundUncompressedSize

        public void outboundUncompressedSize​(long bytes)
        Description copied from class: StreamTracer
        The uncompressed size of some outbound data is revealed. This can only used to record the accumulative outbound uncompressed size. There is no guarantee wrt timing or granularity of this method.
        Overrides:
        outboundUncompressedSize in class StreamTracer
      • inboundWireSize

        public void inboundWireSize​(long bytes)
        Description copied from class: StreamTracer
        The wire size of some inbound data is revealed. This can only be used to record the accumulative received wire size. There is no guarantee wrt timing or granularity of this method.
        Overrides:
        inboundWireSize in class StreamTracer
      • inboundUncompressedSize

        public void inboundUncompressedSize​(long bytes)
        Description copied from class: StreamTracer
        The uncompressed size of some inbound data is revealed. This can only used to record the accumulative received uncompressed size. There is no guarantee wrt timing or granularity of this method.
        Overrides:
        inboundUncompressedSize in class StreamTracer