Documentation ¶
Overview ¶
Package clotel provides re-usable components for OpenTelemetry integration
Index ¶
- func Base() fx.Option
- func NewMeterProvider(cfg Config, det resource.Detector, mtr metric.Reader) (*metric.MeterProvider, error)
- func NewMetricExporter(cfg Config) (metric.Exporter, error)
- func NewTracerProvider(cfg Config, logs *zap.Logger, exp sdktrace.SpanExporter, det resource.Detector, ...) (*sdktrace.TracerProvider, error)
- func Service() fx.Option
- func Test() fx.Option
- func WithExtraEcsAttributes(d resource.Detector) resource.Detector
- type Config
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
NewMetricExporter inits a metric exporter.
func NewTracerProvider ¶ added in v0.6.0
func NewTracerProvider( cfg Config, logs *zap.Logger, exp sdktrace.SpanExporter, det resource.Detector, idg sdktrace.IDGenerator, txtp propagation.TextMapPropagator, ) (*sdktrace.TracerProvider, error)
NewTracerProvider inits a tracer provider.
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.
Click to show internal directories.
Click to hide internal directories.