otelamqp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageCarrier

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

MessageCarrier injects and extracts traces from a Message.

func NewMessageCarrier

func NewMessageCarrier(msg *message.Message) *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.

func (*MessageCarrier) Keys

func (c *MessageCarrier) Keys() []string

Keys returns a slice of all key identifiers in the carrier.

func (*MessageCarrier) Set

func (c *MessageCarrier) Set(key, val string)

Set sets a header.

type PubSub

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

PubSub wraps the publisher/subscriber to inject/collect OpenTelemetry tracing data.

func New

func New(p pubSub) *PubSub

New returns an OpenTelemetry publisher/subscriber wrapper.

func (*PubSub) Publish

func (p *PubSub) Publish(queue string, messages ...*message.Message) error

Publish injects OpenTelemetry tracing data before publishing the given messages.

func (*PubSub) PublishWithOpts

func (p *PubSub) PublishWithOpts(queue string, msg *message.Message, opts ...spi.Option) error

PublishWithOpts injects OpenTelemetry tracing data before publishing the given message.

func (*PubSub) Subscribe

func (p *PubSub) Subscribe(ctx context.Context, queue string) (<-chan *message.Message, error)

Subscribe subscribes to the given queue. When messages are consumed, OpenTelemetry data is extracted from the message header.

func (*PubSub) SubscribeWithOpts

func (p *PubSub) SubscribeWithOpts(ctx context.Context, queue string, opts ...spi.Option) (<-chan *message.Message, error)

SubscribeWithOpts subscribes to the given queue. When messages are consumed, OpenTelemetry data is extracted from the message header.

Jump to

Keyboard shortcuts

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