amqptrace

package
v0.0.0-...-48b9d42 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(ctx context.Context, headers amqp.Table, opts ...Option) ([]label.KeyValue, trace.SpanContext)

Extract returns the correlation context and span context that another service encoded in the rabbitmq Table object with Inject. This function is meant to be used on incoming requests.

func Inject

func Inject(ctx context.Context, headers amqp.Table, opts ...Option)

Inject injects correlation context and span context into the gRPC metadata object. This function is meant to be used on outgoing requests.

Types

type Channel

type Channel struct {
	Ch *amqp.Channel
	// contains filtered or unexported fields
}

Channel is trace channel

func NewChannel

func NewChannel(tracer trace.Tracer, channel *amqp.Channel, opts ...ChannelOption) *Channel

NewChannel create a trace channel

func (*Channel) Publish

func (ch *Channel) Publish(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error

Publish sends a Publishing from the client to an exchange on the server.

type ChannelOption

type ChannelOption func(*channelOptions)

ChannelOption is channel option

func ChannelComopenentName

func ChannelComopenentName(componentName string) ChannelOption

type ConsumeOption

type ConsumeOption func(*consumeOptions)

ConsumeOption is channel option

func ConsumeComopenentName

func ConsumeComopenentName(componentName string) ConsumeOption

type Consumer

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

Consumer is rabbit consumer for trace

func NewConsumer

func NewConsumer(tracer trace.Tracer, delivery <-chan amqp.Delivery, handle func(context.Context, amqp.Delivery) error, opts ...ConsumeOption) *Consumer

NewConsumer create a trace consumer

func (*Consumer) Accpet

func (c *Consumer) Accpet()

Accept accept a message from rabbitmq

type Option

type Option func(*config)

Option is a function that allows configuration of the amqptrace Extract() and Inject() functions

func WithPropagators

func WithPropagators(props propagation.Propagators) Option

WithPropagators sets the propagators to use for Extraction and Injection

Jump to

Keyboard shortcuts

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