otel

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package otel provides OpenTelemetry initialization for tracing, metrics, and logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(ctx context.Context, cfg Config) error

Setup initializes OpenTelemetry providers and registers shutdown handlers. Exporters are configured via OTEL_* environment variables.

Types

type Config

type Config struct {
	// ServiceName is the name of the service. Required.
	ServiceName string `koanf:"service_name"`

	// ServiceVersion is the version of the service. Required.
	ServiceVersion string `koanf:"service_version"`
}

Config holds the configuration for OpenTelemetry setup.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with default values. ServiceName and ServiceVersion are required and must be set by the caller.

Jump to

Keyboard shortcuts

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