clotel

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package clotel provides re-usable components for OpenTelemetry integration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMeterProvider added in v0.6.0

func NewMeterProvider(cfg Config, det resource.Detector, mtr metric.Reader) (*metric.MeterProvider, error)

NewMeterProvider initializes otel provider for metrics throughout the application.

func NewMetricExporter added in v0.6.0

func NewMetricExporter(cfg Config) (metric.Exporter, error)

NewMetricExporter inits a metric exporter.

func NewTracerProvider added in v0.6.0

NewTracerProvider inits a tracer provider.

func Provide added in v0.17.0

func Provide() fx.Option

Provide module with di setup Provide between test and prod environment.

func ServiceProvide added in v0.17.0

func ServiceProvide() fx.Option

ServiceProvide provides otel dependencies for container services.

func TestProvide added in v0.17.0

func TestProvide() fx.Option

TestProvide configures the DI for a test environment.

func WithExtraEcsAttributes added in v0.5.3

func WithExtraEcsAttributes(d resource.Detector) resource.Detector

WithExtraEcsAttributes decorates the detector with extra ecs attributess to fix log tracing.

Types

type Config

type Config struct {
	// DetectorDetectTimeout bound the time it may take to init a trace provider
	DetectorDetectTimeout time.Duration `env:"DETECTOR_DETECT_TIMEOUT" envDefault:"1s"`
	// ExporterTimeout overwrites the timeout for exporting spans. This can be useful in tests to speed
	// them up
	ExporterTimeout time.Duration `env:"EXPORTER_TIMEOUT" envDefault:"10s"`
	// ExporterEndpoint configures where otel span exporter will send data to
	ExporterEndpoint string `env:"EXPORTER_ENDPOINT" envDefault:"localhost:4317"`
	// MetricExporterConnectTimeout configures how long we'll wait for het metric exporter to connect to the collector
	MetricExporterConnectTimeout time.Duration `env:"METRIC_EXPORTER_CONNECT_TIMEOUT" envDefault:"1s"`
}

Config configures the code in this package.

Jump to

Keyboard shortcuts

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