Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetTraceProvider ¶
func SetTraceProvider(tp *sdktrace.TracerProvider)
SetTraceProvider sets global Open Telemetry trace provider to be used.
func TraceHeadersToContext ¶ added in v1.9.0
TraceHeadersToContext maps trace headers in request to context. If there were no tracing headers to be propagated, the original context is returned. The returned bool indicates if the original and the new contexts are the same.
Types ¶
type TraceOTel ¶
type TraceOTel struct {
// contains filtered or unexported fields
}
TraceOTel HTTP trace object.
func NewFromContext ¶
NewFromContext creates new TraceOTel object. Returns nil if tracer not found in context.
func NewFromRequest ¶
NewFromRequest creates new TraceOTel object. Returns nil if tracer not found in request.
Warning: Does not return trace from request context.
func NewFromRequestWithContext ¶ added in v1.9.0
NewFromRequestWithContext creates new TraceOTel object derived from parentCtx. Returns nil if tracer not found in request.
Warning: Does not return trace from request context.
func (*TraceOTel) IsReceived ¶
IsReceived tells whether trace data was received (parsed from a request) or a random one.
func (*TraceOTel) SetHeader ¶
SetHeader sets request headers according to the trace data. This function is dummy, as headers are set at client transport.
func (*TraceOTel) Span ¶
Span spans the existing trace data and puts that into the request. Does not change the input trace data.