Documentation
¶
Overview ¶
Package observability provides structured logging and optional telemetry integration for versionconductor using omniobserve.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggerFromContext ¶
LoggerFromContext retrieves the logger from context. Returns slog.Default() if no logger is in context.
Types ¶
type Config ¶
type Config struct {
// ServiceName is the service name for telemetry.
ServiceName string
// ServiceVersion is the service version.
ServiceVersion string
// LogLevel is the minimum log level.
LogLevel slog.Level
// Verbose enables debug-level logging.
Verbose bool
// Provider is the observability provider name (otlp, newrelic, datadog).
Provider string
// Endpoint is the OTLP endpoint (e.g., localhost:4317).
Endpoint string
// APIKey is the API key for cloud providers (New Relic, Datadog).
APIKey string
// Disabled disables telemetry collection (local logging only).
Disabled bool
}
Config holds observability configuration.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a default configuration for local-only logging.
type Observability ¶
type Observability struct {
// contains filtered or unexported fields
}
Observability manages the observability stack.
func New ¶
func New(cfg Config) (*Observability, error)
New creates a new Observability instance with the given configuration.
func (*Observability) Logger ¶
func (o *Observability) Logger() *slog.Logger
Logger returns the configured slog.Logger.
func (*Observability) Provider ¶
func (o *Observability) Provider() observops.Provider
Provider returns the observability provider (may be nil if disabled).
Click to show internal directories.
Click to hide internal directories.