Documentation ¶
Overview ¶
Package apmrediapmstreadwayamqpgo provides helpers for tracing https://github.com/streadway/amqp
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTraceContext ¶
func ExtractTraceContext(ctx context.Context, tracer *apm.Tracer, del amqp.Delivery) (apm.TraceContext, error)
ExtractTraceContext returns apm.TraceContext from the trace information stored in the headers.
It's the client's choice how to use the provided apm.TraceContext
func InjectTraceContext ¶
func InjectTraceContext(tc apm.TraceContext, msg amqp.Publishing)
InjectTraceContext injects the provided apm.TraceContext in the headers of amqp.Publishing
The header injected is W3C Trace-Context header used for trace propagation => "Traceparent" If the provided msg contains header with this key it will be overwritten
Types ¶
type WrappedChannel ¶
WrappedChannel wraps amqp.Channel such that Publish calls are traced, and trace context is injected into msg.Headers.
Trace context must be supplied using Channel.WithContext. Publish calls ch.Publish. NOTE: ctx is not used for cancellation.
func WrapChannel ¶
func WrapChannel(ch *amqp.Channel) WrappedChannel
func (WrappedChannel) Publish ¶
func (c WrappedChannel) Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
Publish publishes a message and returns an error in encountered.
func (WrappedChannel) WithContext ¶
func (c WrappedChannel) WithContext(ctx context.Context) WrappedChannel