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 ¶
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.