trace

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

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
	Insecure         bool
}

type Option added in v3.3.0

type Option func(*Options)

func WithAlwaysMode added in v3.3.0

func WithAlwaysMode() Option

func WithB3Propagator added in v3.3.0

func WithB3Propagator() Option

WithB3Propagator b3(for zipkin)

func WithEnabled added in v3.3.0

func WithEnabled() Option

func WithEndpoint added in v3.3.0

func WithEndpoint(endpoint string) Option

func WithExporter added in v3.3.0

func WithExporter(exporter string) Option

func WithInsecure added in v3.3.1

func WithInsecure() Option

func WithJaegerExporter added in v3.3.0

func WithJaegerExporter() Option

func WithMode added in v3.3.0

func WithMode(mode string) Option

func WithNeverMode added in v3.3.0

func WithNeverMode() Option

func WithOtlpGrpcExporter added in v3.3.0

func WithOtlpGrpcExporter() Option

func WithOtlpHttpExporter added in v3.3.0

func WithOtlpHttpExporter() Option

func WithPropagator added in v3.3.0

func WithPropagator(propagator string) Option

func WithRatio added in v3.3.0

func WithRatio(ratio float64) Option

WithRatio only takes effect when WithRatioMode is set

func WithRatioMode added in v3.3.0

func WithRatioMode() Option

func WithStdoutExporter added in v3.3.0

func WithStdoutExporter() Option

func WithW3cPropagator added in v3.3.0

func WithW3cPropagator() Option

WithW3cPropagator w3c(standard)

func WithZipkinExporter added in v3.3.0

func WithZipkinExporter() Option

type Options added in v3.3.0

type Options struct {
	Otel *global.OtelConfig
}

func NewOptions added in v3.3.0

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