Documentation ¶
Index ¶
- Constants
- func AppendMessageHeaders(ctx context.Context, span model.SpanContext) context.Context
- func ExtractContextFromMessageHeaders(message *commander.Message) (span model.SpanContext, ok bool)
- func NewSpanConsumeContext(ctx context.Context, span zipkin.Span) context.Context
- func NewSpanProduceContext(ctx context.Context, span zipkin.Span) context.Context
- func SpanConsumeFromContext(ctx context.Context) (span zipkin.Span, ok bool)
- func SpanProduceFromContext(ctx context.Context) (span zipkin.Span, ok bool)
- type Key
Constants ¶
const ( CtxSpanConsume = Key("SpanConsume") CtxSpanProduce = Key("SpanProduce") )
Zipkin context keys
const ( HeaderTraceID = "x-trace-id" HeaderSpanID = "x-span-id" HeaderParentSpanID = "x-parent-span-id" HeaderSampled = "x-trace-sampled" )
Header keys
Variables ¶
This section is empty.
Functions ¶
func AppendMessageHeaders ¶
AppendMessageHeaders construct and appends message span headers
func ExtractContextFromMessageHeaders ¶
func ExtractContextFromMessageHeaders(message *commander.Message) (span model.SpanContext, ok bool)
ExtractContextFromMessageHeaders attempts to extracts the span context from the message headers.
func NewSpanConsumeContext ¶
NewSpanConsumeContext creates a new context with Span attached. If used NewSpanConsumeContext will overwrite any previously-appended types.
func NewSpanProduceContext ¶
NewSpanProduceContext creates a new context with Span attached. If used NewSpanProduceContext will overwrite any previously-appended types.
func SpanConsumeFromContext ¶
SpanConsumeFromContext returns the Span in ctx if it exists. The returned Span should not be modified. Writing to it may cause races. Modification should be made to copies of the returned Header.
func SpanProduceFromContext ¶
SpanProduceFromContext returns the Span in ctx if it exists. The returned Span should not be modified. Writing to it may cause races. Modification should be made to copies of the returned Header.