Documentation
¶
Overview ¶
Package tracectx holds W3C trace context: it parses and formats traceparent headers and carries the current span in a context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SpanContext ¶
SpanContext identifies a span within a trace.
func From ¶
func From(ctx context.Context) (SpanContext, bool)
From returns the current span of ctx.
func Parse ¶
func Parse(h string) (SpanContext, bool)
Parse parses a version-00 traceparent header. It returns false for anything else, so a malformed header starts a new trace instead of failing the request.
func (SpanContext) Traceparent ¶
func (sc SpanContext) Traceparent() string
Traceparent formats sc as a version-00 traceparent header.
func (SpanContext) Valid ¶
func (sc SpanContext) Valid() bool
Valid reports whether both IDs are non-zero.
Click to show internal directories.
Click to hide internal directories.