Documentation
¶
Overview ¶
Package otlp provides OpenTelemetry Protocol (OTLP) provider implementations
Package otlp provides OpenTelemetry Protocol (OTLP) provider implementations
Index ¶
- func NewLoggerProviderWithShutdown(ctx context.Context, config Config, res *resource.Resource) (log.LoggerProvider, func(context.Context) error, error)
- func NewMetricReader(ctx context.Context, config Config) (sdkmetric.Reader, error)
- func NewTracerProviderWithShutdown(ctx context.Context, config Config, res *resource.Resource, ...) (trace.TracerProvider, func(context.Context) error, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggerProviderWithShutdown ¶ added in v0.0.42
func NewLoggerProviderWithShutdown( ctx context.Context, config Config, res *resource.Resource, ) (log.LoggerProvider, func(context.Context) error, error)
NewLoggerProviderWithShutdown creates an OTLP logger provider with a shutdown function. When no endpoint is configured, it returns a no-op provider with a nil shutdown function.
The Logs API/SDK used here (go.opentelemetry.io/otel/log, go.opentelemetry.io/otel/sdk/log, and the otlploghttp exporter) implements the OpenTelemetry specification's Logs API, which is marked Stable (https://opentelemetry.io/docs/specs/otel/logs/api/). Their Go module version (v0.21.0 as of writing) hasn't crossed 1.0 yet, but that mirrors the Prometheus metrics exporter this package already depends on (go.opentelemetry.io/otel/exporters/prometheus, also 0.x): pre-1.0 module versioning here tracks release cadence, not spec/API stability.
func NewMetricReader ¶
NewMetricReader creates an OTLP metric reader for use in a unified meter provider
func NewTracerProviderWithShutdown ¶
func NewTracerProviderWithShutdown( ctx context.Context, config Config, res *resource.Resource, extraProcessors ...sdktrace.SpanProcessor, ) (trace.TracerProvider, func(context.Context) error, error)
NewTracerProviderWithShutdown creates an OTLP tracer provider with a shutdown function. Additional span processors (e.g. a Sentry bridge) can be registered via extraProcessors. When endpoint is empty but extra processors are provided, a real SDK provider is created without an OTLP exporter so the processors still receive spans.