traceotela

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

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

Go to latest
Published: Dec 20, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeDisable = "disable" // Disable trace
	ModeConsole = "console" // trace in console
	ModeRemote  = "remote"  // trace in remote backend
)

Variables

View Source
var (
	ErrHTTPCollectionEndpointRequired = errors.New("http collection endpoint is required for remote mode")
	ErrBatchTimeoutMustBePositive     = errors.New("http collection endpoint is required for remote mode")
)

Functions

func ExtractHTTPHeader

func ExtractHTTPHeader(ctx context.Context, headers http.Header) context.Context

func InitTracer

func InitTracer(ctx context.Context, cfg Config, resource *resource.Resource) (func(context.Context) error, error)

func InjectHTTPHeader

func InjectHTTPHeader(ctx context.Context, headers http.Header)

func ResetTracer

func ResetTracer()

func SetTracer

func SetTracer(name string)

SetTracer sets the tracer with the specified name. This function only takes effect on the first call.

func Tracer

func Tracer() trace.Tracer

Tracer returns the current tracer. If the tracer has not been set previously, nil pointer error.

Types

type Config

type Config struct {
	Mode                   Mode          `koanf:"mode"` // Operating mode for the metrics system
	HTTPCollectionEndpoint string        `koanf:"http_collection_endpoint"`
	GRPCCollectionEndpoint string        `koanf:"grpc_collection_endpoint"`
	BatchTimeout           time.Duration `koanf:"batch_timeout"`
	BatchSize              int           `koanf:"batch_size"`
	SSLMode                bool          `koanf:"ssl_mode"`
	SamplingRatio          float64       `koanf:"sampling_ratio"` // Sampling rate (0-1)
}

Config holds the quick-connect traces system configuration.

type Mode

type Mode string

Mode specifies the operational mode of the metrics system.

Jump to

Keyboard shortcuts

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