traceUtils

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvideTracePropagator

func ProvideTracePropagator(config TracingConfig) (propagation.TextMapPropagator, error)

ProvideTracePropagator wire constructor for Propagator.

func ProvideTracerProvider

func ProvideTracerProvider(
	ctx context.Context,
	config TracingConfig,
) (
	tracerProvider trace.TracerProvider,
	cleaner func(),
	err error,
)

ProvideTracerProvider wire constructor for tracer.

Types

type GrpcOtelCollectorConfig

type GrpcOtelCollectorConfig struct {
	Addr string
}

GrpcOtelCollectorConfig is config for gRPC protocol of OTEL collector.

func DefaultGrpcOtelCollectorConfig

func DefaultGrpcOtelCollectorConfig() GrpcOtelCollectorConfig

DefaultGrpcOtelCollectorConfig constructs GrpcOtelCollectorConfig with default values.

func (*GrpcOtelCollectorConfig) BindFlags

func (config *GrpcOtelCollectorConfig) BindFlags() []cli.Flag

BindFlags of GrpcOtelCollectorConfig for github.com/urfave/cli/v2.Command.

type HTTPOtelCollectorConfig

type HTTPOtelCollectorConfig struct {
	Addr string
}

HTTPOtelCollectorConfig is config for HTTP protocol of OTEL collector.

func DefaultHTTPOtelCollectorConfig

func DefaultHTTPOtelCollectorConfig() HTTPOtelCollectorConfig

DefaultHTTPOtelCollectorConfig constructs HTTPOtelCollectorConfig with default values.

func (*HTTPOtelCollectorConfig) BindFlags

func (config *HTTPOtelCollectorConfig) BindFlags() []cli.Flag

BindFlags of HTTPOtelCollectorConfig for github.com/urfave/cli/v2.Command.

type OtelCollectorConfig

type OtelCollectorConfig struct {
	Protocol OtelCollectorProtocol
	Grpc     GrpcOtelCollectorConfig
	HTTP     HTTPOtelCollectorConfig
}

OtelCollectorConfig is config for OTEL collector.

func DefaultOtelCollectorConfig

func DefaultOtelCollectorConfig() OtelCollectorConfig

DefaultOtelCollectorConfig constructs OtelCollectorConfig with default values.

func (*OtelCollectorConfig) BindFlags

func (config *OtelCollectorConfig) BindFlags() []cli.Flag

BindFlags returns bindings of OtelCollectorConfig for github.com/urfave/cli/v2.Command.

type OtelCollectorProtocol

type OtelCollectorProtocol string

OtelCollectorProtocol type.

func (*OtelCollectorProtocol) Set

func (protocol *OtelCollectorProtocol) Set(value string) error

Set implements github.com/urfave/cli/v2.Generic interface.

func (OtelCollectorProtocol) String

func (protocol OtelCollectorProtocol) String() string

String implements fmt.Stringer interface.

type TracingCollector

type TracingCollector string

TracingCollector type.

func (*TracingCollector) Set

func (collector *TracingCollector) Set(value string) error

Set implements github.com/urfave/cli/v2.Generic interface.

func (TracingCollector) String

func (collector TracingCollector) String() string

String implements fmt.Stringer interface.

type TracingConfig

type TracingConfig struct {
	Collector     TracingCollector
	ServiceName   string
	OtelCollector OtelCollectorConfig
	DialTimeout   time.Duration
	Enabled       bool
	Propagators   []string
	SampleRate    float64

	KeepStatusTrace bool
}

TracingConfig used for enabling and configuration of tracing.

func DefaultTracingConfig

func DefaultTracingConfig() TracingConfig

DefaultTracingConfig returns TracingConfig with default values.

func (*TracingConfig) BindFlags

func (config *TracingConfig) BindFlags() []cli.Flag

BindFlags returns TracingConfig bindings for github.com/urfave/cli/v2.Command.

type UnknownOtelCollectorProtocolError

type UnknownOtelCollectorProtocolError struct {
	// contains filtered or unexported fields
}

UnknownOtelCollectorProtocolError can be returned when provided unknown protocol for OTEL collector.

func NewUnknownOtelCollectorProtocolError

func NewUnknownOtelCollectorProtocolError(value string) *UnknownOtelCollectorProtocolError

NewUnknownOtelCollectorProtocolError constructs new UnknownOtelCollectorProtocolError.

func (*UnknownOtelCollectorProtocolError) Error

Error implements error interface.

type UnknownTracingCollectorError

type UnknownTracingCollectorError struct {
	// contains filtered or unexported fields
}

UnknownTracingCollectorError returned when provided unknown tracing collector.

func NewUnknownTracingCollectorError

func NewUnknownTracingCollectorError(value string) *UnknownTracingCollectorError

NewUnknownTracingCollectorError constructs new UnknownTracingCollectorError.

func (*UnknownTracingCollectorError) Error

func (err *UnknownTracingCollectorError) Error() string

Error implements error interface.

Jump to

Keyboard shortcuts

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