Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetOTel ¶
func SetOTel(enabled bool, tp *sdktrace.TracerProvider)
SetOTel enables/disables Open Telemetry. By default it is disabled. Tracer provider can be set with an exporter and collector endpoint you need.
func SetOTelGrpc ¶ added in v1.7.3
SetOTelGrpc enables Open Telemetry. Activates trace export to the OTLP gRPC collector target address defined. Port is 4317, unless defined otherwise in provided target string.
Types ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is a HTTP trace handler of various kinds.
func NewFromRequest ¶
NewFromRequest creates new tracer object from request. Returns nil if not found.
func NewFromRequestOrRandom ¶
NewFromRequestOrRandom creates new tracer object. If no trace data, then create random. Never returns nil.
Warning: Does not return trace from request context.
func NewFromRequestWithContext ¶ added in v1.9.0
NewFromRequestWithContext creates new tracer object from request derived from parentCtx if otel. Returns nil if not found.
func (*Tracer) IsReceived ¶
IsReceived tells whether trace data was received (parsed from a request) or a random one.
func (*Tracer) SetHeader ¶
SetHeader sets request headers according to the trace data. Input headers object must not be nil.
func (*Tracer) 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.