tracing

package
v0.0.0-...-9245d8b Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const OtelLibraryName = "github.com/patrickjmcd/bunny"

Variables

This section is empty.

Functions

func DestinationTopic

func DestinationTopic(topic string) attribute.KeyValue

func EndSpan

func EndSpan(s oteltrace.Span, err error)

func MessageHeaders

func MessageHeaders(headers amqp.Table) []attribute.KeyValue

func MessageKey

func MessageKey(messageID string) attribute.KeyValue

func Operation

func Operation(operationName Op) attribute.KeyValue

func RoutingKey

func RoutingKey(routingKey string) attribute.KeyValue

func SystemKey

func SystemKey() attribute.KeyValue

Types

type MessageCarrier

type MessageCarrier struct {
	// contains filtered or unexported fields
}

MessageCarrier injects and extracts traces from an amqp.Delivery.

func NewMessageCarrier

func NewMessageCarrier(msg *amqp.Delivery) MessageCarrier

NewMessageCarrier creates a new MessageCarrier.

func (MessageCarrier) Get

func (c MessageCarrier) Get(key string) string

Get retrieves a single value for a given key from rabbit message headers.

func (MessageCarrier) Keys

func (c MessageCarrier) Keys() []string

Keys returns all keys identifiers from the message headers.

func (MessageCarrier) Set

func (c MessageCarrier) Set(key, value string)

Set sets a header on rabbit message.

type Op

type Op string
const (
	OperationProduce Op = "produce"
	OperationConsume Op = "consume"
	OperationDelay   Op = "delay"

	MessagingSystemKeyValue = "rabbitmq"
)

type ProducerMessageCarrier

type ProducerMessageCarrier struct {
	// contains filtered or unexported fields
}

ProducerMessageCarrier injects and extracts traces from a rabbit message.

func NewProducerMessageCarrier

func NewProducerMessageCarrier(msg *amqp.Publishing) ProducerMessageCarrier

NewProducerMessageCarrier creates a new MessageCarrier.

func (ProducerMessageCarrier) Get

Get retrieves a single value for a given key from rabbit message headers.

func (ProducerMessageCarrier) Keys

func (c ProducerMessageCarrier) Keys() []string

Keys returns all keys identifiers from the message headers.

func (ProducerMessageCarrier) Set

func (c ProducerMessageCarrier) Set(key, value string)

Set sets a header on rabbit message.

Jump to

Keyboard shortcuts

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