tracing

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRPC protocol = "gRPC"
	HTTP protocol = "HTTP"
)

Variables

View Source
var DefaultOTLConfig = &OTLConfig{
	Protocol: GRPC,
	Endpoint: getDefaultOTLEndpoint(),
	Sampler:  sdktrace.ParentBased(sdktrace.TraceIDRatioBased(0.1)),
	Exporter: os.Getenv("OTEL_EXPORTER_NAME"),
	URLPath:  "/ote/v1/traces",
	IsExport: true,
}

Functions

func GetAmTraceID

func GetAmTraceID(ctx context.Context) string

func GetCloudflareRayID

func GetCloudflareRayID(ctx context.Context) string

func InitOTLProvider

func InitOTLProvider(config *OTLConfig) (func() error, error)

InitOTLProvider initializes an OTLP exporter, and configures the corresponding trace providers.

func WithAmTraceID

func WithAmTraceID(parent context.Context, traceID string) context.Context

func WithCloudflareRayID

func WithCloudflareRayID(parent context.Context, cloudflareRayID string) context.Context

Types

type OTLConfig

type OTLConfig struct {
	Protocol protocol
	Endpoint string
	Sampler  sdktrace.Sampler
	Exporter string
	URLPath  string
	IsExport bool
}

Jump to

Keyboard shortcuts

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