tracing

package
v2.0.0-...-9971990 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package tracing provide tracing feature for GRPC.

Refer to: opentelemetry-go-contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go

Index

Constants

View Source
const (
	// GRPCStatusCodeKey is convention for numeric status code of a gRPC request.
	GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
)

Variables

This section is empty.

Functions

func Extract

func Extract(ctx context.Context, metadata metadata.MD) (baggage.Baggage, trace.SpanContext)

Extract returns the correlation context and span context that another service encoded in the gRPC metadata object with Inject. This function is meant to be used on incoming requests.

func Inject

func Inject(ctx context.Context, metadata metadata.MD)

Inject injects correlation context and span context into the gRPC metadata object. This function is meant to be used on outgoing requests.

func StreamClientInterceptor

func StreamClientInterceptor(
	ctx context.Context, desc *grpc.StreamDesc,
	cc *grpc.ClientConn, method string, streamer grpc.Streamer,
	callOpts ...grpc.CallOption) (grpc.ClientStream, error)

StreamClientInterceptor returns a grpc.StreamClientInterceptor suitable for use in a grpc.Dial call.

func StreamServerInterceptor

func StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

StreamServerInterceptor returns a grpc.StreamServerInterceptor suitable for use in a grpc.NewServer call.

func UnaryClientInterceptor

func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{},
	cc *grpc.ClientConn, invoker grpc.UnaryInvoker, callOpts ...grpc.CallOption) error

UnaryClientInterceptor returns a grpc.UnaryClientInterceptor suitable for use in a grpc.Dial call.

func UnaryServerInterceptor

func UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

UnaryServerInterceptor returns a grpc.UnaryServerInterceptor suitable for usage in a grpc.NewServer call.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL