msgtracing

package
v2.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package msgtracing contains msg middlewares to add opentracing support.

Index

Constants

This section is empty.

Variables

View Source
var (
	// PublisherComponentTag is added to each publisher span.
	PublisherComponentTag = ot.Tag{
		Key:   string(otext.Component),
		Value: "npmsg.publisher",
	}
	// AsyncPublisherComponentTag is added to each async publisher span.
	AsyncPublisherComponentTag = ot.Tag{
		Key:   string(otext.Component),
		Value: "npmsg.async.publisher",
	}
	// SubscriberComponentTag is added to each subscriber span.
	SubscriberComponentTag = ot.Tag{
		Key:   string(otext.Component),
		Value: "npmsg.subscriber",
	}
)
View Source
var (
	// PublisherOpName is used to generate operation name of a msg publish span.
	PublisherOpName = func(spec MsgSpec) string {
		return fmt.Sprintf("Msg Publisher %s", spec.SubjectName())
	}
	// AsyncPublisherOpName is used to generate operation name of a async msg publish span.
	AsyncPublisherOpName = func(spec MsgSpec) string {
		return fmt.Sprintf("Msg AsyncPublisher %s", spec.SubjectName())
	}
	// SubscriberOpName is used to generate operation name of a subscriber span.
	SubscriberOpName = func(spec MsgSpec, queue string) string {
		return fmt.Sprintf("Msg Subscriber %s:%s", spec.SubjectName(), queue)
	}
)

Functions

func WrapMsgAsyncPublisher

func WrapMsgAsyncPublisher(tracer ot.Tracer, downstream bool) MsgAsyncPublisherMiddleware

WrapMsgAsyncPublisher adds opentracing support for MsgAsyncPublisher. Pass true to `downstream` if the publisher is used as msg pipe downstream.

func WrapMsgPublisher

func WrapMsgPublisher(tracer ot.Tracer, downstream bool) MsgPublisherMiddleware

WrapMsgPublisher adds opentracing support for MsgPublisher. Pass true to `downstream` if the publisher is used as msg pipe downstream.

func WrapMsgSubscriber

func WrapMsgSubscriber(tracer ot.Tracer) MsgMiddleware

WrapMsgSubscriber adds opentracing support for MsgSubscriber.

Types

This section is empty.

Jump to

Keyboard shortcuts

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