amqpxotel

package module
v0.0.0-...-64a2558 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package amqpxotel provides supporting opentracing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor

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

func NewInterceptor

func NewInterceptor(opts ...Option) *Interceptor

NewInterceptor returns a new otel interceptor.

func (*Interceptor) WrapConsume

func (i *Interceptor) WrapConsume(next amqpx.ConsumeFunc) amqpx.ConsumeFunc

func (*Interceptor) WrapPublish

func (i *Interceptor) WrapPublish(next amqpx.PublishFunc) amqpx.PublishFunc

type Option

type Option func(*config)

An Option configuring the OpenTelemetry instrumentation.

func WithAckStatus

func WithAckStatus(ackStatus func(amqpx.Action) (code codes.Code, description string)) Option

WithAckStatus configures the Interceptor to handle the acknowledgment status. By default, amqpx.Ack sets codes.Ok and other codes.Unset.

func WithConsumeFilter

func WithConsumeFilter(filter func(context.Context, *amqpx.DeliveryRequest) bool) Option

WithConsumeFilter configures the Interceptor to emit traces when the filter function returns true.

func WithConsumeSpanName

func WithConsumeSpanName(operationName func(context.Context, *amqpx.DeliveryRequest) string) Option

WithConsumeSpanName configures the Interceptor to span name.

func WithNotTrustRemote

func WithNotTrustRemote() Option

WithNotTrustRemote sets the Interceptor to not trust remote spans. By default, all incoming spans are trusted and will be a child span. When WithNotTrustRemote is used, all incoming spans are untrusted and will be linked with a trace.Link and will not be a child span.

func WithPropagator

func WithPropagator(propagator propagation.TextMapPropagator) Option

WithPropagator configures the instrumentation to use the supplied propagator when extracting and injecting trace context. By default, the instrumentation uses otel.GetTextMapPropagator().

func WithPublishFilter

func WithPublishFilter(filter func(context.Context, *amqpx.PublishingRequest) bool) Option

WithPublishFilter configures the Interceptor to emit traces when the filter function returns true.

func WithPublishSpanName

func WithPublishSpanName(operationName func(context.Context, *amqpx.PublishingRequest) string) Option

WithPublishSpanName configures the Interceptor span name.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider configures the instrumentation to use the supplied provider when creating a tracer. By default, the instrumentation uses otel.GetTracerProvider().

Jump to

Keyboard shortcuts

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