traceb3

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TraceB3

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

TraceB3 HTTP trace object of B3 or X-B3 kind.

func NewFromRequest

func NewFromRequest(r *http.Request) *TraceB3

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

Warning: Does not return trace from request context.

func NewRandom

func NewRandom() *TraceB3

NewRandom creates new TraceB3 object with random content.

func (*TraceB3) IsReceived

func (b3 *TraceB3) IsReceived() bool

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

func (*TraceB3) SetHeader

func (b3 *TraceB3) SetHeader(headers http.Header)

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

func (*TraceB3) Span

func (b3 *TraceB3) 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 (*TraceB3) SpanID

func (b3 *TraceB3) SpanID() string

SpanID returns the span ID of the trace data.

func (*TraceB3) String

func (b3 *TraceB3) String() string

String makes a log string from trace data.

func (*TraceB3) TraceID

func (b3 *TraceB3) 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