tracing

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package tracing contains middlewares for RPCServer/RPCClient/MsgPublisher/MsgSubscriber to add opentracing support.

Index

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.

Jump to

Keyboard shortcuts

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