opentracing

package
v0.0.0-...-b08fcc5 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RpcContextKey = "_rpc_context_key"

Variables

View Source
var (
	//TracingComponentTag tags
	TracingComponentTag = opentracing.Tag{Key: string(ext.Component), Value: "gRPC"}
)

Functions

func NewClientTraceWrapper

func NewClientTraceWrapper(trace opentracing.Tracer) client.Wrapper

NewClientTraceWrapper accepts an open tracing Trace and returns a Client Wrapper

func NewServerTraceHandler

func NewServerTraceHandler(trace opentracing.Tracer) server.HandlerWrapper

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, tracer opentracing.Tracer, endpoint string) (context.Context, opentracing.Span, error)

StartSpanFromContext returns a new span with the given operation name and options. If a span is found in the context, it will be used as the parent of the resulting span.

Types

type RpcClientContext

type RpcClientContext struct {
	Endpoint  string
	Request   interface{}
	Response  interface{}
	TraceID   string
	StartTime time.Time
}

type TraceWrapper

type TraceWrapper struct {
	client.Client
	Trace opentracing.Tracer
}

TraceWrapper trace 包装器

func (*TraceWrapper) Call

func (o *TraceWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) (err error)

func (*TraceWrapper) Publish

func (o *TraceWrapper) Publish(ctx context.Context, p client.Message, opts ...client.PublishOption) error

func (*TraceWrapper) Stream

func (o *TraceWrapper) Stream(ctx context.Context, req client.Request, opts ...client.CallOption) (client.Stream, error)

Jump to

Keyboard shortcuts

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