otel

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: Zlib Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog added in v0.1.0

func InitLog(ctx context.Context, c *config) *sdklog.LoggerProvider

func InitMetric added in v0.1.0

func InitMetric(ctx context.Context, c *config) func(context.Context) error

InitTrace initializes the OpenTelemetry trace exporter with the given config. It returns a function to shut down the exporter when done.

func InitTrace

func InitTrace(ctx context.Context, c *config) func(context.Context) error

InitTrace initializes the OpenTelemetry trace exporter with the given config. It returns a function to shut down the exporter when done.

func NewConfig added in v0.1.0

func NewConfig(opts ...Option) *config

NewConfig creates a new config with default values, and applies any provided options to customize it.

func NewLogger added in v0.1.0

func NewLogger(ctx context.Context, c *config) *slog.Logger

func SetOtel added in v0.1.1

func SetOtel(ctx context.Context, c commonConfig.OtelConfig) func(ctx context.Context)

Types

type Option added in v0.1.0

type Option func(*config)

Option is a function that modifies the config.

func WithClientType added in v0.1.0

func WithClientType(clientType string) Option

WithClientType sets the client type for the OpenTelemetry exporter.

func WithEndpoint added in v0.1.0

func WithEndpoint(endpoint string) Option

WithEndpoint sets the endpoint for the OpenTelemetry exporter.

func WithHeaders added in v0.1.0

func WithHeaders(headers map[string]string) Option

WithHeaders sets the headers for the OpenTelemetry exporter.

Jump to

Keyboard shortcuts

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