amqp091otel

package module
v0.0.0-...-920c138 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

README

OpenTelemetry RabbitMQ Client Instrumentation for Golang

ci codecov

This module provides OpenTelemetry instrumentation for the Go RabbitMQ Client Library github.com/rabbitmq/amqp091-go.

As for now, this module only provides tracing instrumentation.

Compatibility

This module supports the same go versions as the opentelemetry-go project.

Installation

go get -u github.com/wzy9607/amqp091otel

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextFromDelivery

func ContextFromDelivery(msg amqp091.Delivery) context.Context

ContextFromDelivery returns the context that contains the traces associated with the amqp091.Delivery. If the delivery does not contain traces, it returns a background context. Consumer can use this function to continue the distributed tracing.

Types

type Channel

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

Channel wraps an amqp091.Channel with OpenTelemetry tracing instrumentation.

func NewChannel

func NewChannel(amqpChan *amqp091.Channel, url string, opts ...Option) (*Channel, error)

NewChannel returns an amqp091.Channel with OpenTelemetry tracing instrumentation.

func (*Channel) Consume

func (ch *Channel) Consume(
	queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp091.Table,
) (<-chan amqp091.Delivery, error)

func (*Channel) Get

func (ch *Channel) Get(queue string, autoAck bool) (msg amqp091.Delivery, ok bool, err error)

func (*Channel) PublishWithContext

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

func (*Channel) PublishWithDeferredConfirmWithContext

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

type Option

type Option func(*config)

Option sets optional config properties.

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

WithPropagators sets the propagators.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider sets the tracer provider.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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