Documentation
¶
Overview ¶
Package otel provides integration between containerd/log and OpenTelemetry.
In particular, it provides a hook that records log entries as events on active OpenTelemetry spans.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookOpt ¶
type HookOpt func(*LogrusHook)
func WithErrorStatusLevel ¶
WithErrorStatusLevel configures the minimum log level that marks the active span with an error status.
func WithLevel ¶
WithLevel configures the minimum log level handled by the hook. Entries below this level are ignored.
func WithTraceIDField ¶
type LogrusHook ¶
type LogrusHook struct {
// contains filtered or unexported fields
}
LogrusHook is a logrus.Hook which adds logrus events to active spans. If the span is not recording or the span context is invalid, the hook is a no-op.
func NewLogrusHook ¶
func NewLogrusHook(opts ...HookOpt) *LogrusHook
NewLogrusHook creates a new logrus hook
func (*LogrusHook) Fire ¶
func (h *LogrusHook) Fire(entry *log.Entry) error
Fire is called when a log event occurs.
func (*LogrusHook) Levels ¶
func (h *LogrusHook) Levels() []log.Level
Levels returns the logrus levels that this hook is interested in.