Documentation
¶
Overview ¶
Package amqpxotel provides supporting opentracing.
Index ¶
- type Interceptor
- type Option
- func WithAckStatus(ackStatus func(amqpx.Action) (code codes.Code, description string)) Option
- func WithConsumeFilter(filter func(context.Context, *amqpx.DeliveryRequest) bool) Option
- func WithConsumeSpanName(operationName func(context.Context, *amqpx.DeliveryRequest) string) Option
- func WithNotTrustRemote() Option
- func WithPropagator(propagator propagation.TextMapPropagator) Option
- func WithPublishFilter(filter func(context.Context, *amqpx.PublishingRequest) bool) Option
- func WithPublishSpanName(operationName func(context.Context, *amqpx.PublishingRequest) string) Option
- func WithTracerProvider(provider trace.TracerProvider) Option
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 ¶
WithAckStatus configures the Interceptor to handle the acknowledgment status. By default, amqpx.Ack sets codes.Ok and other codes.Unset.
func WithConsumeFilter ¶
WithConsumeFilter configures the Interceptor to emit traces when the filter function returns true.
func WithConsumeSpanName ¶
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 ¶
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().