metadata

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CtxSpanConsume = Key("SpanConsume")
	CtxSpanProduce = Key("SpanProduce")
)

Zipkin context keys

View Source
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

func AppendMessageHeaders(ctx context.Context, span model.SpanContext) context.Context

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

func NewSpanConsumeContext(ctx context.Context, span zipkin.Span) context.Context

NewSpanConsumeContext creates a new context with Span attached. If used NewSpanConsumeContext will overwrite any previously-appended types.

func NewSpanProduceContext

func NewSpanProduceContext(ctx context.Context, span zipkin.Span) context.Context

NewSpanProduceContext creates a new context with Span attached. If used NewSpanProduceContext will overwrite any previously-appended types.

func SpanConsumeFromContext

func SpanConsumeFromContext(ctx context.Context) (span zipkin.Span, ok bool)

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

func SpanProduceFromContext(ctx context.Context) (span zipkin.Span, ok bool)

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.

Types

type Key

type Key string

Key context key type

Jump to

Keyboard shortcuts

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