trace

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package trace is for collecting tracing data and adapting with backend tracing systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExporter

func NewExporter(config *ExporterConfig, customFunc func() (sdktrace.SpanExporter, error)) (tracerProvider *sdktrace.TracerProvider, propagator propagation.TextMapPropagator, err error)

NewExporter is an absolute function with @customFunc to create a spec exporter

Types

type DefaultExporter

type DefaultExporter struct {
	TracerProvider *sdktrace.TracerProvider
	Propagator     propagation.TextMapPropagator
}

func (*DefaultExporter) GetPropagator

func (e *DefaultExporter) GetPropagator() propagation.TextMapPropagator

func (*DefaultExporter) GetTracerProvider

func (e *DefaultExporter) GetTracerProvider() *sdktrace.TracerProvider

type Exporter

type Exporter interface {
	GetTracerProvider() *sdktrace.TracerProvider
	GetPropagator() propagation.TextMapPropagator
}

type ExporterConfig

type ExporterConfig struct {
	Exporter         string
	Endpoint         string
	SampleMode       string
	SampleRatio      float64
	Propagator       string
	ServiceNamespace string
	ServiceName      string
	ServiceVersion   string
}

type Option

type Option func(*Options)

func WithAlwaysMode

func WithAlwaysMode() Option

func WithB3Propagator

func WithB3Propagator() Option

WithB3Propagator b3(for zipkin)

func WithEnabled

func WithEnabled() Option

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithExporter

func WithExporter(exporter string) Option

func WithJaegerExporter

func WithJaegerExporter() Option

func WithMode

func WithMode(mode string) Option

func WithNeverMode

func WithNeverMode() Option

func WithOtlpGrpcExporter

func WithOtlpGrpcExporter() Option

func WithOtlpHttpExporter

func WithOtlpHttpExporter() Option

func WithPropagator

func WithPropagator(propagator string) Option

func WithRatio

func WithRatio(ratio float64) Option

WithRatio only takes effect when WithRatioMode is set

func WithRatioMode

func WithRatioMode() Option

func WithStdoutExporter

func WithStdoutExporter() Option

func WithW3cPropagator

func WithW3cPropagator() Option

WithW3cPropagator w3c(standard)

func WithZipkinExporter

func WithZipkinExporter() Option

type Options

type Options struct {
	Otel *global.OtelConfig
}

func NewOptions

func NewOptions(opts ...Option) *Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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