Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGlobalLogger ¶
GetGlobalLogger returns a component-specific logger using the global console logger.
func SetGlobalLogLevel ¶
func SetGlobalLogLevel(level string)
SetGlobalLogLevel sets the global log level for console logging. Deprecated: Use proper telemetry configuration instead.
Types ¶
type Config ¶
type Config struct {
// Enabled when false disables OpenTelemetry entirely.
Enabled bool `env:"OTEL_ENABLED" envDefault:"true"`
// Endpoint is the OTLP collector endpoint.
Endpoint string `env:"OTEL_ENDPOINT" envDefault:"jaeger:4317"`
// TraceSampleRate is the sampling rate for traces (0.0 to 1.0).
TraceSampleRate float64 `env:"OTEL_TRACE_SAMPLE_RATE" envDefault:"1.0"`
// Log level configuration ("debug", "info", "warn", "error").
LogLevel string `env:"OTEL_LOG_LEVEL" envDefault:"info"`
// Log format configuration ("json", "pretty").
LogFormat string `env:"OTEL_LOG_FORMAT" envDefault:"json"`
}
type LogFormat ¶
type LogFormat uint8
LogFormat represents the log output format.
func ParseLogFormat ¶
ParseLogFormat converts a string to LogFormat enum.
type Telemetry ¶
type Telemetry struct {
Logger zerolog.Logger
Tracer trace.Tracer
// contains filtered or unexported fields
}
func (*Telemetry) GetLoggerWithTrace ¶
GetLoggerWithTrace returns a component-specific logger enriched with trace context.
Click to show internal directories.
Click to hide internal directories.