trace

package
v0.0.0-...-3bd2c62 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCompression = errors.New("not a valid Compression")
View Source
var ErrInvalidExporter = errors.New("not a valid Exporter")
View Source
var ErrInvalidPropagator = errors.New("not a valid Propagator")
View Source
var ErrInvalidProtocol = errors.New("not a valid Protocol")
View Source
var ErrInvalidSampler = errors.New("not a valid Sampler")

Functions

func NewClient

func NewClient(options ClientOptions) (otlptrace.Client, error)

func NewResource

func NewResource(ctx context.Context) (*resource.Resource, error)

func NewSampler

func NewSampler(options SamplerOptions) (trace.Sampler, error)

func NewSpanExporters

func NewSpanExporters(ctx context.Context, options SpanExportersOptions) ([]trace.SpanExporter, error)

func NewTextMapPropagator

func NewTextMapPropagator(propagators Propagators) propagation.TextMapPropagator

func NewTracerProvider

func NewTracerProvider(ctx context.Context, options TracerProviderOptions) (*trace.TracerProvider, func())

Types

type BatchTimeout

type BatchTimeout time.Duration

BatchTimeout represents a duration used for timeout configurations.

type ClientOptions

type ClientOptions struct {
	Protocol    Protocol
	Endpoint    Endpoint
	Compression Compression
}

type Compression

type Compression string

Compression defines the compression type to use on OTLP. ENUM(none, gzip)

const (
	// CompressionNone is a Compression of type none.
	CompressionNone Compression = "none"
	// CompressionGzip is a Compression of type gzip.
	CompressionGzip Compression = "gzip"
)

func ParseCompression

func ParseCompression(name string) (Compression, error)

ParseCompression attempts to convert a string to a Compression.

func (Compression) IsValid

func (x Compression) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Compression) String

func (x Compression) String() string

String implements the Stringer interface.

type Endpoint

type Endpoint url.URL

Endpoint represents a trace endpoint as a URL.

type Exporter

type Exporter string

Exporter defines a trace exporter type responsible for delivering spans to external receivers. ENUM(zipkin, otlp, none, jaeger, logging)

const (
	// ExporterZipkin is a Exporter of type zipkin.
	ExporterZipkin Exporter = "zipkin"
	// ExporterOtlp is a Exporter of type otlp.
	ExporterOtlp Exporter = "otlp"
	// ExporterNone is a Exporter of type none.
	ExporterNone Exporter = "none"
	// ExporterJaeger is a Exporter of type jaeger.
	ExporterJaeger Exporter = "jaeger"
	// ExporterLogging is a Exporter of type logging.
	ExporterLogging Exporter = "logging"
)

func ParseExporter

func ParseExporter(name string) (Exporter, error)

ParseExporter attempts to convert a string to a Exporter.

func (Exporter) IsValid

func (x Exporter) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Exporter) String

func (x Exporter) String() string

String implements the Stringer interface.

type Exporters

type Exporters []Exporter

Exporters is a slice of Exporter instances representing multiple trace exporters.

type Propagator

type Propagator string

Propagator determine which distributed tracing header formats are used, and which baggage propagation header formats are used. ENUM(tracecontext, baggage, b3, b3multi, jaeger, xray, ottrace)

const (
	// PropagatorTracecontext is a Propagator of type tracecontext.
	PropagatorTracecontext Propagator = "tracecontext"
	// PropagatorBaggage is a Propagator of type baggage.
	PropagatorBaggage Propagator = "baggage"
	// PropagatorB3 is a Propagator of type b3.
	PropagatorB3 Propagator = "b3"
	// PropagatorB3multi is a Propagator of type b3multi.
	PropagatorB3multi Propagator = "b3multi"
	// PropagatorJaeger is a Propagator of type jaeger.
	PropagatorJaeger Propagator = "jaeger"
	// PropagatorXray is a Propagator of type xray.
	PropagatorXray Propagator = "xray"
	// PropagatorOttrace is a Propagator of type ottrace.
	PropagatorOttrace Propagator = "ottrace"
)

func ParsePropagator

func ParsePropagator(name string) (Propagator, error)

ParsePropagator attempts to convert a string to a Propagator.

func (Propagator) IsValid

func (x Propagator) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Propagator) String

func (x Propagator) String() string

String implements the Stringer interface.

type Propagators

type Propagators []Propagator

Propagators is a slice of Propagator instances representing multiple propagators.

type Protocol

type Protocol string

Protocol defines the encoding of telemetry data and the protocol used to exchange spans between the client and the server. ENUM(grpc, http/protobuf)

const (
	// ProtocolGrpc is a Protocol of type grpc.
	ProtocolGrpc Protocol = "grpc"
	// ProtocolHttpProtobuf is a Protocol of type http/protobuf.
	ProtocolHttpProtobuf Protocol = "http/protobuf"
)

func ParseProtocol

func ParseProtocol(name string) (Protocol, error)

ParseProtocol attempts to convert a string to a Protocol.

func (Protocol) IsValid

func (x Protocol) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Protocol) String

func (x Protocol) String() string

String implements the Stringer interface.

type Sampler

type Sampler string

Sampler configures whether spans will be recorded. ENUM(always_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off, parentbased_traceidratio)

const (
	// SamplerAlwaysOn is a Sampler of type always_on.
	SamplerAlwaysOn Sampler = "always_on"
	// SamplerAlwaysOff is a Sampler of type always_off.
	SamplerAlwaysOff Sampler = "always_off"
	// SamplerTraceidratio is a Sampler of type traceidratio.
	SamplerTraceidratio Sampler = "traceidratio"
	// SamplerParentbasedAlwaysOn is a Sampler of type parentbased_always_on.
	SamplerParentbasedAlwaysOn Sampler = "parentbased_always_on"
	// SamplerParentbasedAlwaysOff is a Sampler of type parentbased_always_off.
	SamplerParentbasedAlwaysOff Sampler = "parentbased_always_off"
	// SamplerParentbasedTraceidratio is a Sampler of type parentbased_traceidratio.
	SamplerParentbasedTraceidratio Sampler = "parentbased_traceidratio"
)

func ParseSampler

func ParseSampler(name string) (Sampler, error)

ParseSampler attempts to convert a string to a Sampler.

func (Sampler) IsValid

func (x Sampler) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Sampler) String

func (x Sampler) String() string

String implements the Stringer interface.

type SamplerArg

type SamplerArg float64

SamplerArg represents an argument used by certain samplers, specifically for traceidratio and parentbased_traceidratio.

type SamplerOptions

type SamplerOptions struct {
	Sampler    Sampler
	SamplerArg SamplerArg
}

type SpanExportersOptions

type SpanExportersOptions struct {
	Exporters Exporters
	Client    otlptrace.Client
}

type TracerProviderOptions

type TracerProviderOptions struct {
	Resource     *resource.Resource
	Sampler      trace.Sampler
	Exporters    []trace.SpanExporter
	BatchTimeout BatchTimeout
	Propagator   propagation.TextMapPropagator
	Logger       logr.Logger
}

Jump to

Keyboard shortcuts

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