otlp

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 37 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefPeriodicReaderInterval = 2 * time.Second
	DefBatchTimeout           = 2 * time.Second
	DefShutdownTimeout        = 5 * time.Second
)

Variables

This section is empty.

Functions

func CreateAttributesFrom

func CreateAttributesFrom(appCfg commoncfg.Application, attrs ...attribute.KeyValue) []attribute.KeyValue

CreateAttributesFrom builds a slice of OTEL attributes from the application config and optional extra attributes.

func Init

func Init(ctx context.Context,
	appCfg *commoncfg.Application,
	telCfg *commoncfg.Telemetry,
	logCfg *commoncfg.Logger,
	options ...Option,
) error

Init creates a registry, applies all options and startss the initialization.

func NewClientHandler

func NewClientHandler() stats.Handler

NewClientHandler returns a gRPC stats.Handler configured for client-side telemetry.

func NewServerHandler

func NewServerHandler() stats.Handler

NewServerHandler returns a gRPC stats.Handler configured for server-side telemetry.

Types

type Option

type Option func(*registry)

func WithLogger

func WithLogger(log *slog.Logger) Option

WithLogger accepts a custom logger to be used for logging telemetry events.

func WithShutdownComplete

func WithShutdownComplete(shutdownComplete chan struct{}) Option

WithShutdownComplete accepts a channel to signal when the shutdown is complete.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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