tracing

package
v3.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCarrierIntoContext

func ExtractCarrierIntoContext(ctx context.Context, headers http.Header) context.Context

ExtractCarrierIntoContext reads cross-cutting concerns from the carrier into a Context.

func InjectContextIntoCarrier

func InjectContextIntoCarrier(req *http.Request)

InjectContextIntoCarrier sets cross-cutting concerns from the request context into the request headers.

func SetStatusErrorf

func SetStatusErrorf(ctx context.Context, format string, args ...interface{})

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

type Span struct {
	trace.Span
	// contains filtered or unexported fields
}

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

type Tracer struct {
	trace.Tracer
	// contains filtered or unexported fields
}

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

func NewTracing(conf *static.Tracing) (*Tracer, io.Closer, error)

NewTracing Creates a Tracing.

func TracerFromContext

func TracerFromContext(ctx context.Context) *Tracer

TracerFromContext extracts the trace.Tracer from the given context.

func (*Tracer) CaptureClientRequest

func (t *Tracer) CaptureClientRequest(span trace.Span, r *http.Request)

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

func (t *Tracer) CaptureServerRequest(span trace.Span, r *http.Request)

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.

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

Start starts a new span. spancheck linter complains about span.End not being called, but this is expected here, hence its deactivation.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL