clotel

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 26 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 Base added in v0.5.2

func Base() fx.Option

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

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 Service

func Service() fx.Option

Service provides otel dependencies for container services.

func Test

func Test() fx.Option

Test 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