opentracing

package module
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package opentracing provides wrappers for OpenTracing

Index

Constants

This section is empty.

Variables

View Source
var MetadataKey = textproto.CanonicalMIMEHeaderKey("x-request-id")

MetadataKey contains metadata key

Functions

func DefaultClientCallFuncObserver

func DefaultClientCallFuncObserver(ctx context.Context, addr string, req client.Request, rsp interface{}, opts client.CallOptions, sp opentracing.Span, err error)

func DefaultClientCallObserver

func DefaultClientCallObserver(ctx context.Context, req client.Request, rsp interface{}, opts []client.CallOption, sp opentracing.Span, err error)

func DefaultClientPublishObserver

func DefaultClientPublishObserver(ctx context.Context, msg client.Message, opts []client.PublishOption, sp opentracing.Span, err error)

func DefaultClientStreamObserver

func DefaultClientStreamObserver(ctx context.Context, req client.Request, opts []client.CallOption, stream client.Stream, sp opentracing.Span, err error)

func DefaultServerHandlerObserver

func DefaultServerHandlerObserver(ctx context.Context, req server.Request, rsp interface{}, sp opentracing.Span, err error)

func DefaultServerSubscriberObserver

func DefaultServerSubscriberObserver(ctx context.Context, msg server.Message, sp opentracing.Span, err error)

func NewClientCallWrapper

func NewClientCallWrapper(opts ...Option) client.CallWrapper

NewClientCallWrapper accepts an opentracing Tracer and returns a Call Wrapper

func NewClientWrapper

func NewClientWrapper(opts ...Option) client.Wrapper

NewClientWrapper accepts an open tracing Trace and returns a Client Wrapper

func NewServerHandlerWrapper

func NewServerHandlerWrapper(opts ...Option) server.HandlerWrapper

NewServerHandlerWrapper accepts an options and returns a Handler Wrapper

func NewServerSubscriberWrapper

func NewServerSubscriberWrapper(opts ...Option) server.SubscriberWrapper

NewServerSubscriberWrapper accepts an opentracing Tracer and returns a Subscriber Wrapper

func StartSpanFromIncomingContext

func StartSpanFromIncomingContext(ctx context.Context, tracer opentracing.Tracer, name string, opts ...opentracing.StartSpanOption) (context.Context, opentracing.Span, error)

StartSpanFromIncomingContext 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.

func StartSpanFromOutgoingContext

func StartSpanFromOutgoingContext(ctx context.Context, tracer opentracing.Tracer, name string, opts ...opentracing.StartSpanOption) (context.Context, opentracing.Span, error)

StartSpanFromOutgoingContext 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 ClientCallFuncObserver

type ClientCallFuncObserver func(context.Context, string, client.Request, interface{}, client.CallOptions, opentracing.Span, error)

type ClientCallObserver

type ClientCallObserver func(context.Context, client.Request, interface{}, []client.CallOption, opentracing.Span, error)

type Option

type Option func(*Options)

func WithClientCallFuncObservers

func WithClientCallFuncObservers(ob ...ClientCallFuncObserver) Option

func WithClientCallObservers

func WithClientCallObservers(ob ...ClientCallObserver) Option

func WithClientPublishObservers

func WithClientPublishObservers(ob ...ClientPublishObserver) Option

func WithClientStreamObservers

func WithClientStreamObservers(ob ...ClientStreamObserver) Option

func WithServerHandlerObservers

func WithServerHandlerObservers(ob ...ServerHandlerObserver) Option

func WithServerSubscriberObservers

func WithServerSubscriberObservers(ob ...ServerSubscriberObserver) Option

func WithTracer

func WithTracer(ot opentracing.Tracer) Option

type Options

type Options struct {
	Tracer                    opentracing.Tracer
	ClientCallObservers       []ClientCallObserver
	ClientStreamObservers     []ClientStreamObserver
	ClientPublishObservers    []ClientPublishObserver
	ClientCallFuncObservers   []ClientCallFuncObserver
	ServerHandlerObservers    []ServerHandlerObserver
	ServerSubscriberObservers []ServerSubscriberObserver
}

func NewOptions

func NewOptions(opts ...Option) Options

type ServerHandlerObserver

type ServerHandlerObserver func(context.Context, server.Request, interface{}, opentracing.Span, error)

type ServerSubscriberObserver

type ServerSubscriberObserver func(context.Context, server.Message, opentracing.Span, error)

Jump to

Keyboard shortcuts

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