traceparent

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TraceParent

type TraceParent struct {
	// contains filtered or unexported fields
}

TraceParent HTTP trace object. See https://www.w3.org/TR/trace-context

func NewFromRequest

func NewFromRequest(r *http.Request) *TraceParent

NewFromRequest creates new TraceParent object. If there is no trace data in request, then returns nil.

func (*TraceParent) IsReceived

func (p *TraceParent) IsReceived() bool

IsReceived tells whether trace data was received (parsed from a request) or a random one.

func (*TraceParent) SetHeader

func (p *TraceParent) SetHeader(headers http.Header)

SetHeader sets request headers according to the trace data. Input headers object must not be nil.

func (*TraceParent) Span

func (p *TraceParent) Span(r *http.Request) (*http.Request, string)

Span spans the existing trace data and puts that into the request. Returns the updated request and a trace string for logging. Does not change the input trace data.

func (*TraceParent) SpanID

func (p *TraceParent) SpanID() string

SpanID returns the span ID of the trace data.

func (*TraceParent) String

func (p *TraceParent) String() string

String makes a log string from trace data.

func (*TraceParent) TraceID

func (p *TraceParent) TraceID() string

TraceID returns the trace ID of the trace data.

Jump to

Keyboard shortcuts

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