otellogrus

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: BSD-2-Clause Imports: 9 Imported by: 2

README

PkgGoDev

OpenTelemetry Go instrumentation for logrus logging

Moved to https://github.com/uptrace/opentelemetry-go-extra/tree/main/otellogrus

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook added in v1.0.3

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

Hook is a logrus hook that adds logs to the active span as events.

func NewHook added in v1.0.3

func NewHook(opts ...Option) *Hook

NewHook returns a logrus hook.

func NewLoggingHook

func NewLoggingHook(opts ...Option) *Hook

Deprecated. Use NewHook instead.

func (*Hook) Fire added in v1.0.3

func (hook *Hook) Fire(entry *logrus.Entry) error

Fire is a logrus hook that is fired on a new log entry.

func (*Hook) Levels added in v1.0.3

func (hook *Hook) Levels() []logrus.Level

Levels returns logrus levels on which this hook is fired.

type Option

type Option func(h *Hook)

Option applies a configuration to the given config.

func WithErrorStatusLevel

func WithErrorStatusLevel(level logrus.Level) Option

WithErrorStatusLevel sets the minimal logrus logging level on which the span status is set to codes.Error.

The default is <= logrus.ErrorLevel.

func WithLevels

func WithLevels(levels ...logrus.Level) Option

WithLevels sets the logrus logging levels on which the hook is fired.

The default is all levels between logrus.PanicLevel and logrus.WarnLevel inclusive.

Directories

Path Synopsis
example module

Jump to

Keyboard shortcuts

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