otelzap

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCore

func NewCore(logger otellog.Logger, opts ...Option) zapcore.Core

NewOtelCore initializes an OpenTelemetry Core for exporting logs in OTLP format

Types

type Option

type Option func(c *OtelZapCore)

func WithLevel

func WithLevel(level zapcore.Level) Option

WithLevel sets the minimum level for the OpenTelemetry Core log to be exported

func WithLevelEnabler

func WithLevelEnabler(levelEnabler zapcore.LevelEnabler) Option

WithLevelEnabler sets the zapcore.LevelEnabler for determining which log levels to export

type OtelZapCore

type OtelZapCore struct {
	// contains filtered or unexported fields
}

OtelZapCore is a zapcore.Core implementation that exports logs to OpenTelemetry It implements the zapcore.Core interface and uses OpenTelemetry's logging API

func (OtelZapCore) Check

func (o OtelZapCore) Check(entry zapcore.Entry, checked *zapcore.CheckedEntry) *zapcore.CheckedEntry

Check checks if the given log entry is enabled for the OpenTelemetry Core

func (OtelZapCore) Enabled

func (o OtelZapCore) Enabled(level zapcore.Level) bool

Enabled checks if the given log level is enabled for the OpenTelemetry Core

func (OtelZapCore) Sync

func (o OtelZapCore) Sync() error

func (OtelZapCore) With

func (o OtelZapCore) With(fields []zapcore.Field) zapcore.Core

With returns a new OpenTelemetry Core with the given fields added to the log entry

func (OtelZapCore) Write

func (o OtelZapCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

Jump to

Keyboard shortcuts

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