amqptrace

package module
v0.0.0-...-f8831ec Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

amqptrace

AMQP instrumentation in Go for opentelemetry

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) ([]kv.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 DeliveryHandle

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

DeliveryHandle is trace handler of the delivery

func NewDeliveryHandle

func NewDeliveryHandle(tracer trace.Tracer, opts ...DeliveryHandleOption) *DeliveryHandle

NewDeliveryHandle create a DeliveryHandle

func (*DeliveryHandle) Do

func (h *DeliveryHandle) Do(msg amqp.Delivery, handle func(context.Context, amqp.Delivery) error)

type DeliveryHandleOption

type DeliveryHandleOption func(*deliveryHandleOptions)

DeliveryHandleOption is optional configuration of delivery handle

func DeliveryHandleComopenentName

func DeliveryHandleComopenentName(componentName string) DeliveryHandleOption

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