Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNoopMeter ¶ added in v0.2.1
NewNoopMeter - Creates new noop meter
Types ¶
type HandlerFn ¶ added in v0.9.6
HandlerFn defines the handler used by slog.Handler as return value.
func NewOtelHandler ¶ added in v0.9.6
func NewOtelHandler(opts ...OtelHandlerOpt) HandlerFn
NewOtelHandler creates and returns a new HandlerFn, which wraps a handler with OtelHandler to use with log/slog.
type OtelHandler ¶ added in v0.9.6
type OtelHandler struct { // Next represents the next handler in the chain. Next slog.Handler // NoBaggage determines whether to add context baggage members to the log record. NoBaggage bool // NoTraceEvents determines whether to record an event for every log on the active trace. NoTraceEvents bool }
func New ¶ added in v0.9.6
func New(next slog.Handler, opts ...OtelHandlerOpt) *OtelHandler
New creates a new OtelHandler to use with log/slog
func (OtelHandler) Enabled ¶ added in v0.9.6
Enabled reports whether the logger emits log records at the given context and level. Note: We handover the decision down to the next handler.
func (OtelHandler) Handle ¶ added in v0.9.6
Handle handles the provided log record and adds correlation between a slog record and an Open-Telemetry span.
type OtelHandlerOpt ¶ added in v0.9.6
type OtelHandlerOpt func(handler *OtelHandler)
func WithNoBaggage ¶ added in v0.9.6
func WithNoBaggage(noBaggage bool) OtelHandlerOpt
WithNoBaggage returns an OtelHandlerOpt, which sets the NoBaggage flag
func WithNoTraceEvents ¶ added in v0.9.6
func WithNoTraceEvents(noTraceEvents bool) OtelHandlerOpt
WithNoTraceEvents returns an OtelHandlerOpt, which sets the NoTraceEvents flag