package stats

Import Path
	google.golang.org/grpc/stats (on go.dev)

Dependency Relation
	imports 4 packages, and imported by 2 packages

Involved Source Files handlers.go Package stats is for collecting and reporting various network and RPC stats. This package is for monitoring purpose only. All fields are read-only. All APIs are experimental.
Package-Level Type Names (total 19, in which 15 are exported)
/* sort exporteds by: | */
Begin contains stats when an RPC attempt begins. FailFast is only valid if this Begin is from client side. BeginTime is the time when the RPC attempt begins. Client is true if this Begin is from client side. FailFast indicates if this RPC is failfast. IsClientStream indicates whether the RPC is a client streaming RPC. IsServerStream indicates whether the RPC is a server streaming RPC. IsTransparentRetryAttempt indicates whether this attempt was initiated due to transparently retrying a previous attempt. IsClient indicates if the stats information is from client side. *Begin : RPCStats
ConnBegin contains the stats of a connection when it is established. Client is true if this ConnBegin is from client side. IsClient indicates if this is from client side. *ConnBegin : ConnStats
ConnEnd contains the stats of a connection when it ends. Client is true if this ConnBegin is from client side. IsClient indicates if this is from client side. *ConnEnd : ConnStats
ConnStats contains stats information about connections. IsClient returns true if this ConnStats is from client side. *ConnBegin *ConnEnd func Handler.HandleConn(context.Context, ConnStats)
ConnTagInfo defines the relevant information needed by connection context tagger. LocalAddr is the local address of the corresponding connection. RemoteAddr is the remote address of the corresponding connection. func Handler.TagConn(context.Context, *ConnTagInfo) context.Context
End contains stats when an RPC ends. BeginTime is the time when the RPC began. Client is true if this End is from client side. EndTime is the time when the RPC ends. Error is the error the RPC ended with. It is an error generated from status.Status and can be converted back to status.Status using status.FromError if non-nil. Trailer contains the trailer metadata received from the server. This field is only valid if this End is from the client side. Deprecated: use Trailer in InTrailer instead. IsClient indicates if this is from client side. *End : RPCStats
Handler defines the interface for the related stats handling (e.g., RPCs, connections). HandleConn processes the Conn stats. HandleRPC processes the RPC stats. TagConn can attach some information to the given context. The returned context will be used for stats handling. For conn stats handling, the context used in HandleConn for this connection will be derived from the context returned. For RPC stats handling, - On server side, the context used in HandleRPC for all RPCs on this connection will be derived from the context returned. - On client side, the context is not derived from the context returned. TagRPC can attach some information to the given context. The context used for the rest lifetime of the RPC will be derived from the returned context. func google.golang.org/grpc.StatsHandler(h Handler) grpc.ServerOption func google.golang.org/grpc.WithStatsHandler(h Handler) grpc.DialOption func google.golang.org/grpc/internal/transport.NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []Handler) (transport.ServerTransport, error)
InHeader contains stats when a header is received. Client is true if this InHeader is from client side. Compression is the compression algorithm used for the RPC. The following fields are valid only if Client is false. FullMethod is the full RPC method string, i.e., /package.service/method. Header contains the header metadata received. LocalAddr is the local address of the corresponding connection. RemoteAddr is the remote address of the corresponding connection. WireLength is the wire length of header. IsClient indicates if the stats information is from client side. *InHeader : RPCStats
InPayload contains the information for an incoming payload. Client is true if this InPayload is from client side. Data is the serialized message payload. Length is the length of uncompressed data. Payload is the payload with original type. RecvTime is the time when the payload is received. WireLength is the length of data on wire (compressed, signed, encrypted). IsClient indicates if the stats information is from client side. *InPayload : RPCStats
InTrailer contains stats when a trailer is received. Client is true if this InTrailer is from client side. Trailer contains the trailer metadata received from the server. This field is only valid if this InTrailer is from the client side. WireLength is the wire length of trailer. IsClient indicates if the stats information is from client side. *InTrailer : RPCStats
OutHeader contains stats when a header is sent. Client is true if this OutHeader is from client side. Compression is the compression algorithm used for the RPC. The following fields are valid only if Client is true. FullMethod is the full RPC method string, i.e., /package.service/method. Header contains the header metadata sent. LocalAddr is the local address of the corresponding connection. RemoteAddr is the remote address of the corresponding connection. IsClient indicates if this stats information is from client side. *OutHeader : RPCStats
OutPayload contains the information for an outgoing payload. Client is true if this OutPayload is from client side. Data is the serialized message payload. Length is the length of uncompressed data. Payload is the payload with original type. SentTime is the time when the payload is sent. WireLength is the length of data on wire (compressed, signed, encrypted). IsClient indicates if this stats information is from client side. *OutPayload : RPCStats
OutTrailer contains stats when a trailer is sent. Client is true if this InTrailer is from client side. Trailer contains the trailer metadata received from the server. This field is only valid if this InTrailer is from the client side. WireLength is the wire length of trailer. IsClient indicates if this stats information is from client side. *OutTrailer : RPCStats
RPCStats contains stats information about RPCs. IsClient returns true if this RPCStats is from client side. *Begin *End *InHeader *InPayload *InTrailer *OutHeader *OutPayload *OutTrailer func Handler.HandleRPC(context.Context, RPCStats)
RPCTagInfo defines the relevant information needed by RPC context tagger. FailFast indicates if this RPC is failfast. This field is only valid on client side, it's always false on server side. FullMethodName is the RPC method in the format of /package.service/method. func Handler.TagRPC(context.Context, *RPCTagInfo) context.Context
Package-Level Functions (total 8, all are exported)
OutgoingTags returns the tags from the context for the outbound RPC. This is intended for gRPC-internal use ONLY.
OutgoingTrace returns the trace from the context for the outbound RPC. It is intended for gRPC-internal use.
SetIncomingTags attaches stats tagging data to the context, to be read by the application (not sent in outgoing RPCs). This is intended for gRPC-internal use ONLY.
SetIncomingTrace attaches stats tagging data to the context, to be read by the application (not sent in outgoing RPCs). It is intended for gRPC-internal use.
SetTags attaches stats tagging data to the context, which will be sent in the outgoing RPC with the header grpc-tags-bin. Subsequent calls to SetTags will overwrite the values from earlier calls. NOTE: this is provided only for backward compatibility with existing clients and will likely be removed in an upcoming release. New uses should transmit this type of data using metadata with a different, non-reserved (i.e. does not begin with "grpc-") header name.
SetTrace attaches stats tagging data to the context, which will be sent in the outgoing RPC with the header grpc-trace-bin. Subsequent calls to SetTrace will overwrite the values from earlier calls. NOTE: this is provided only for backward compatibility with existing clients and will likely be removed in an upcoming release. New uses should transmit this type of data using metadata with a different, non-reserved (i.e. does not begin with "grpc-") header name.
Tags returns the tags from the context for the inbound RPC. NOTE: this is provided only for backward compatibility with existing clients and will likely be removed in an upcoming release. New uses should transmit this type of data using metadata with a different, non-reserved (i.e. does not begin with "grpc-") header name.
Trace returns the trace from the context for the inbound RPC. NOTE: this is provided only for backward compatibility with existing clients and will likely be removed in an upcoming release. New uses should transmit this type of data using metadata with a different, non-reserved (i.e. does not begin with "grpc-") header name.