trace

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatchError

func CatchError(span trace.Span, err error) error

func Init

func Init(ctx context.Context, opts ...IniterOption) error

func NewSampler added in v0.6.1

func NewSampler(opts ...SamplerOption) (trace.Sampler, error)

func RegisterError

func RegisterError(span trace.Span, err error)

func SpanName

func SpanName() string

func StartNamedSpan

func StartNamedSpan(
	ctx context.Context,
	opts ...trace.SpanStartOption,
) (
	context.Context,
	trace.Span,
)

func StartSpan

func StartSpan(
	ctx context.Context,
	spanName string,
	opts ...trace.SpanStartOption,
) (
	context.Context,
	trace.Span,
)

func TraceparentFromContext

func TraceparentFromContext(ctx context.Context) string

func TraceparentToContext

func TraceparentToContext(ctx context.Context, traceparent string) context.Context

Types

type Config

type Config struct {
	AppName            string        `yaml:"app_name" validate:"required"`
	Ratio              float64       `yaml:"ratio" validate:"gte=0.01,lte=1"`
	SampleErrors       bool          `yaml:"sample_errors"`
	SampleLongDuration time.Duration `yaml:"sample_long_duration"`
}

type IniterOption added in v0.6.1

type IniterOption = c.Option[initer]

func WithBatcherOptions added in v0.6.1

func WithBatcherOptions(opts ...trace.BatchSpanProcessorOption) IniterOption

func WithCmdName added in v0.6.1

func WithCmdName(cmdName string) IniterOption

func WithExporterOptions added in v0.6.1

func WithExporterOptions(opts ...otlptracegrpc.Option) IniterOption

func WithSamplerOptions added in v0.6.1

func WithSamplerOptions(opts ...SamplerOption) IniterOption

type SamplerOption added in v0.6.1

type SamplerOption = c.Option[sampler]

func WithSampleDuration added in v0.6.1

func WithSampleDuration(d time.Duration) SamplerOption

func WithSampleError added in v0.6.1

func WithSampleError(sampleErrors bool) SamplerOption

func WithSampleRatio added in v0.6.1

func WithSampleRatio(ratio float64) SamplerOption

Jump to

Keyboard shortcuts

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