Documentation ¶
Overview ¶
Package tracing contains middlewares for RPCServer/RPCClient/MsgPublisher/MsgSubscriber to add opentracing support.
Index ¶
- Variables
- func WrapMsgAsyncPublisher(tracer ot.Tracer, downstream bool) nproto.MsgAsyncPublisherMiddleware
- func WrapMsgPublisher(tracer ot.Tracer, downstream bool) nproto.MsgPublisherMiddleware
- func WrapMsgSubscriber(tracer ot.Tracer) nproto.MsgMiddleware
- func WrapRPCClient(tracer ot.Tracer) nproto.RPCMiddleware
- func WrapRPCServer(tracer ot.Tracer) nproto.RPCMiddleware
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ComponentTag is attached to each sapn. ComponentTag = ot.Tag{ Key: string(otext.Component), Value: "nproto.tracing", } // TracingMDKey is the nproto.MD key to carry tracing data. TracingMDKey = "NProtoTracing" // ClientHandlerOpNameFmt is used to generate operation name of a RPC client handler span. ClientHandlerOpNameFmt = func(svcName string, method *nproto.RPCMethod) string { return fmt.Sprintf("RPC Client %s:%s", svcName, method.Name) } // ServerHandlerOpNameFmt is used to generate operation name of a RPC server handler span. ServerHandlerOpNameFmt = func(svcName string, method *nproto.RPCMethod) string { return fmt.Sprintf("RPC Server %s:%s", svcName, method.Name) } // PublishOpNameFmt is used to generate operation name of a msg publish span. PublishOpNameFmt = func(subject string) string { return fmt.Sprintf("Msg Publisher %s", subject) } // PublishAsyncOpNameFmt is used to generate operation name of a async msg publish span. PublishAsyncOpNameFmt = func(subject string) string { return fmt.Sprintf("Msg PublishAsync %s", subject) } // SubscriberHandlerOpNameFmt is used to generate operation name of a subscription handler span. SubscriberHandlerOpNameFmt = func(subject, queue string) string { return fmt.Sprintf("Msg Subscriber %s:%s", subject, queue) } )
Functions ¶
func WrapMsgAsyncPublisher ¶ added in v0.9.1
func WrapMsgAsyncPublisher(tracer ot.Tracer, downstream bool) nproto.MsgAsyncPublisherMiddleware
WrapMsgAsyncPublisher adds opentracing support for MsgAsyncPublisher.
func WrapMsgPublisher ¶ added in v0.9.1
func WrapMsgPublisher(tracer ot.Tracer, downstream bool) nproto.MsgPublisherMiddleware
WrapMsgPublisher adds opentracing support for MsgPublisher.
func WrapMsgSubscriber ¶ added in v0.9.1
func WrapMsgSubscriber(tracer ot.Tracer) nproto.MsgMiddleware
WrapMsgSubscriber adds opentracing support for MsgSubscriber.
func WrapRPCClient ¶ added in v0.9.1
func WrapRPCClient(tracer ot.Tracer) nproto.RPCMiddleware
WrapRPCClient adds opentracing support for RPCClient.
func WrapRPCServer ¶ added in v0.9.1
func WrapRPCServer(tracer ot.Tracer) nproto.RPCMiddleware
WrapRPCServer adds opentracing support for RPCServer.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.