tracing

package
v0.0.0-...-1b39580 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPProvider

func HTTPProvider(serviceName string, cfg JaegerConfig) error

func InitSpan

func InitSpan(ctx context.Context, tracer, spanName string) (context.Context, trace.Span)

func InitTracer

func InitTracer(serviceName, instanceName string) (trace.Tracer, func(), error)

InitTracer creates a new tracer for a service.

func NewJaegerTracer

func NewJaegerTracer(cfg JaegerConfig) (*tracesdk.TracerProvider, error)

func NewOTELTracerProvider

func NewOTELTracerProvider(serviceName, instanceName string) (*tracesdk.TracerProvider, error)

tracerProvider returns an OpenTelemetry TracerProvider configured to use the Jaeger exporter that will send spans to the provided url. The returned TracerProvider will also use a Resource configured with all the information about the application.

func OTELGRPCProvider

func OTELGRPCProvider(serviceName string, cfg JaegerConfig) error

func RecordError

func RecordError(span trace.Span, err error)

func RegisterMetricsEndpoint

func RegisterMetricsEndpoint(addr string)

Types

type JaegerConfig

type JaegerConfig struct {
	ServiceName string `mapstructure:"serviceName"`
	Env         string `mapstructure:"env"`
	Addr        string `mapstructure:"addr"`
	Enable      bool   `mapstructure:"enable"`
	LogSpans    bool   `mapstructure:"logSpans"`
	ID          int64  `mapstructure:"id"`
}

Jump to

Keyboard shortcuts

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