Documentation ¶
Index ¶
- func ExtractCarrierIntoContext(ctx context.Context, headers http.Header) context.Context
- func InjectContextIntoCarrier(req *http.Request)
- func SetStatusErrorf(ctx context.Context, format string, args ...interface{})
- type Backend
- type Span
- type Tracer
- func (t *Tracer) CaptureClientRequest(span trace.Span, r *http.Request)
- func (t *Tracer) CaptureResponse(span trace.Span, responseHeaders http.Header, code int, ...)
- func (t *Tracer) CaptureServerRequest(span trace.Span, r *http.Request)
- func (t *Tracer) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- type TracerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractCarrierIntoContext ¶
ExtractCarrierIntoContext reads cross-cutting concerns from the carrier into a Context.
func InjectContextIntoCarrier ¶
InjectContextIntoCarrier sets cross-cutting concerns from the request context into the request headers.
func SetStatusErrorf ¶
SetStatusErrorf flags the span as in error and log an event.
Types ¶
type Backend ¶
type Backend interface {
Setup(serviceName string, sampleRate float64, globalAttributes map[string]string) (trace.Tracer, io.Closer, error)
}
Backend is an abstraction for tracking backend (OpenTelemetry, ...).
type Span ¶
Span is trace.Span wrapping the Traefik TracerProvider.
func (Span) TracerProvider ¶
func (s Span) TracerProvider() trace.TracerProvider
TracerProvider returns the span's TraceProvider.
type Tracer ¶
Tracer is trace.Tracer with additional properties.
func NewTracer ¶
func NewTracer(tracer trace.Tracer, capturedRequestHeaders, capturedResponseHeaders []string) *Tracer
NewTracer builds and configures a new Tracer.
func NewTracing ¶
NewTracing Creates a Tracing.
func TracerFromContext ¶
TracerFromContext extracts the trace.Tracer from the given context.
func (*Tracer) CaptureClientRequest ¶
CaptureClientRequest used to add span attributes from the request as a Client. TODO: need to update the semconv package as it does not implement fully Semantic Convention v1.23.0.
func (*Tracer) CaptureResponse ¶
func (t *Tracer) CaptureResponse(span trace.Span, responseHeaders http.Header, code int, spanKind trace.SpanKind)
CaptureResponse captures the response attributes to the span.
func (*Tracer) CaptureServerRequest ¶
CaptureServerRequest used to add span attributes from the request as a Server. TODO: need to update the semconv package as it does not implement fully Semantic Convention v1.23.0.
type TracerProvider ¶
type TracerProvider struct { trace.TracerProvider // contains filtered or unexported fields }
TracerProvider is trace.TracerProvider wrapping the Traefik Tracer implementation.
func (TracerProvider) Tracer ¶
func (t TracerProvider) Tracer(name string, options ...trace.TracerOption) trace.Tracer
Tracer returns the trace.Tracer for the given options. It returns specifically the Traefik Tracer when requested.