otel

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMeterToCtx

func AddMeterToCtx(ctx context.Context, meter metric.Meter) context.Context

func AddTracerToCtx

func AddTracerToCtx(ctx context.Context, tracer trace.Tracer) context.Context

func GetMeter

func GetMeter(ctx context.Context, components ...string) metric.Meter

func GetTracer

func GetTracer(ctx context.Context, components ...string) trace.Tracer

func Init

func Init(ctx context.Context) (context.Context, func(context.Context) error)

Context must carry config.AppConfig

func MustMeterFromCtx

func MustMeterFromCtx(ctx context.Context) metric.Meter

func MustTracerFromCtx

func MustTracerFromCtx(ctx context.Context) trace.Tracer

func NewTracer

func NewTracer(options ...trace.TracerOption) trace.Tracer

Creates a new tracer from the global opentelemetry provider

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}
var (
	EnableStdoutExporter     Option = enableStdoutExporter{}
	EnablePrometheusExporter Option = enablePrometheusExporter{}
	// Overide the default metric export interval
	WithMetricExportInterval = func(interval time.Duration) Option {
		return exportInterval{interval: interval}
	}
)

OTEL Options

Jump to

Keyboard shortcuts

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