Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTraceContext ¶
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
WrapChannel wraps ampq.Channel and returns apmstreadwayamqp.WrappedChannel which wraps amqp.Channel in a traced manner
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 if encountered.
Publish will trace the operation as a span if the context associated with the channel (i.e. supplied with WithContext) contains an `*apm.Transaction.`. The trace context will be propagated as headers in the published message.
func (WrappedChannel) WithContext ¶
func (c WrappedChannel) WithContext(ctx context.Context) WrappedChannel
WithContext supplies context.Context to apmstreadwayamqp.WrappedChannel.