Documentation ¶
Index ¶
- func AddSegmentToContext(seg *segment.Segment, ctx context.Context) context.Context
- func GRPCClientUnaryInterceptor(ctx context.Context, method string, req interface{}, reply interface{}, ...) error
- func GRPCServerUnaryInterceptor(name string) ...
- func GetSegmentFromContext(ctx context.Context) (*segment.Segment, error)
- func NewGRPCClientConn(target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func NewHTTPClient(seg *segment.Segment) *http.Client
- func NewHTTPInterceptor(seg *segment.Segment) http.RoundTripper
- func SetSegmentCacheDuration(duration time.Duration)
- type HTTPInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSegmentToContext ¶
AddSegmentToContext adds a segment reference to a context.Context instance.
func GRPCClientUnaryInterceptor ¶
func GRPCClientUnaryInterceptor( ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption, ) error
GRPCClientUnaryInterceptor is a gRPC unary interceptor for tracing outbound gRPC requests
func GRPCServerUnaryInterceptor ¶
func GRPCServerUnaryInterceptor(name string) func( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
GRPCServerUnaryInterceptor is a gRPC unary interceptor for tracing inbound gRPC requests.
func GetSegmentFromContext ¶
GetSegmentFromContext retrieves a segment from a context.Context instance.
func NewGRPCClientConn ¶
func NewGRPCClientConn( target string, opts ...grpc.DialOption, ) (*grpc.ClientConn, error)
NewGRPCClientConn creates a new gRPC client connection with a unary interceptor that performs traces of gRPC requests.
func NewHTTPClient ¶
NewHTTPClient creates a new HTTP client for a segment.
func NewHTTPInterceptor ¶
func NewHTTPInterceptor(seg *segment.Segment) http.RoundTripper
NewHTTPInterceptor creates a new HTTPInterceptor.
func SetSegmentCacheDuration ¶
SetSegmentCacheDuration updates the duration of segments in in-memory cache
Types ¶
type HTTPInterceptor ¶
type HTTPInterceptor struct {
// contains filtered or unexported fields
}
HTTPInterceptor represents an http.RoundTripper that also performs tracing of requests by creating subsegments of the segment.