observability

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(ctx context.Context, fn func())

func CallSafe

func CallSafe(ctx context.Context, fn func())

func CtxWithLogstash

func CtxWithLogstash(
	ctx context.Context,
	logstashAddr string,
	appName string,
) context.Context

func Go

func Go(ctx context.Context, fn func())

func GoSafe

func GoSafe(ctx context.Context, fn func())

func IsOnInsecureDebug

func IsOnInsecureDebug(ctx context.Context) bool

func NewHookAdapter

func NewHookAdapter(
	l *logrus.Logger,
	h logrus.Hook,
) logger.Hook

func OnInsecureDebug

func OnInsecureDebug(ctx context.Context) context.Context

func PanicIfNotNil

func PanicIfNotNil(ctx context.Context, r any)

func ParseSecretsFrom

func ParseSecretsFrom(obj any) []string

func ParseStringsFrom

func ParseStringsFrom(obj any) []string

func ReportPanicIfNotNil

func ReportPanicIfNotNil(ctx context.Context, r any) bool

func WithSecretsProvider

func WithSecretsProvider(ctx context.Context, secretsProvider SecretsProvider) context.Context

Types

type ErrorMonitorLoggerHook

type ErrorMonitorLoggerHook struct {
	ErrorMonitor errmontypes.ErrorMonitor
	SendChan     chan ErrorMonitorMessage
}

func NewErrorMonitorLoggerHook

func NewErrorMonitorLoggerHook(
	errorMonitor errmon.ErrorMonitor,
) *ErrorMonitorLoggerHook

func (*ErrorMonitorLoggerHook) ProcessInput

func (h *ErrorMonitorLoggerHook) ProcessInput(
	traceIDs belt.TraceIDs,
	level loggertypes.Level,
	args ...any,
) loggertypes.PreHookResult

func (*ErrorMonitorLoggerHook) ProcessInputFields

func (h *ErrorMonitorLoggerHook) ProcessInputFields(
	traceIDs belt.TraceIDs,
	level loggertypes.Level,
	message string,
	fields field.AbstractFields,
) loggertypes.PreHookResult

func (*ErrorMonitorLoggerHook) ProcessInputf

func (h *ErrorMonitorLoggerHook) ProcessInputf(
	traceIDs belt.TraceIDs,
	level loggertypes.Level,
	format string,
	args ...any,
) loggertypes.PreHookResult

type ErrorMonitorMessage

type ErrorMonitorMessage struct {
	Entry              *loggertypes.Entry
	Goroutines         []errmontypes.Goroutine
	CurrentGoroutineID int
	StackTrace         xruntime.PCs
}

type Flusher

type Flusher interface {
	Flush()
}

type FlusherDeadlined

type FlusherDeadlined interface {
	Flush(timeout time.Duration)
}

type FlusherDeadlinedErr

type FlusherDeadlinedErr interface {
	Flush(timeout time.Duration) error
}

type FlusherErr

type FlusherErr interface {
	Flush() error
}

type HookAdapter

type HookAdapter struct {
	Locker       xsync.Mutex
	LogrusLogger *logrus.Logger
	LogrusHook   logrus.Hook
}

func (*HookAdapter) Flush

func (h *HookAdapter) Flush()

func (*HookAdapter) ProcessLogEntry

func (h *HookAdapter) ProcessLogEntry(entry *logger.Entry) bool

type LogLevelFilterT

type LogLevelFilterT struct {
	Locker xsync.Mutex
	Level  loggertypes.Level
}
var LogLevelFilter LogLevelFilterT

func (*LogLevelFilterT) GetLevel

func (h *LogLevelFilterT) GetLevel() loggertypes.Level

func (*LogLevelFilterT) ProcessInput

func (h *LogLevelFilterT) ProcessInput(
	traceIDs belt.TraceIDs,
	level loggertypes.Level,
	args ...any,
) loggertypes.PreHookResult

func (*LogLevelFilterT) ProcessInputFields

func (h *LogLevelFilterT) ProcessInputFields(
	traceIDs belt.TraceIDs,
	level loggertypes.Level,
	message string,
	fields field.AbstractFields,
) loggertypes.PreHookResult

func (*LogLevelFilterT) ProcessInputf

func (h *LogLevelFilterT) ProcessInputf(
	traceIDs belt.TraceIDs,
	level loggertypes.Level,
	format string,
	args ...any,
) loggertypes.PreHookResult

func (*LogLevelFilterT) SetLevel

func (h *LogLevelFilterT) SetLevel(
	level loggertypes.Level,
)

type RemoveInsecureDebugFilter

type RemoveInsecureDebugFilter struct{}

func NewRemoveInsecureDebugFilter

func NewRemoveInsecureDebugFilter() *RemoveInsecureDebugFilter

func (*RemoveInsecureDebugFilter) Flush

func (f *RemoveInsecureDebugFilter) Flush()

func (*RemoveInsecureDebugFilter) ProcessLogEntry

func (f *RemoveInsecureDebugFilter) ProcessLogEntry(entry *logger.Entry) bool

type SecretValuesFilter

type SecretValuesFilter struct {
	SecretsProvider SecretsProvider
}

func NewSecretValuesFilter

func NewSecretValuesFilter(sp SecretsProvider) *SecretValuesFilter

func (*SecretValuesFilter) ProcessInput

func (sf *SecretValuesFilter) ProcessInput(
	_ belt.TraceIDs,
	_ logger.Level,
	args ...any,
) loggertypes.PreHookResult

func (*SecretValuesFilter) ProcessInputFields

func (sf *SecretValuesFilter) ProcessInputFields(
	_ belt.TraceIDs,
	_ logger.Level,
	message string,
	fields field.AbstractFields,
) loggertypes.PreHookResult

func (*SecretValuesFilter) ProcessInputf

func (sf *SecretValuesFilter) ProcessInputf(
	_ belt.TraceIDs,
	_ logger.Level,
	format string,
	args ...any,
) loggertypes.PreHookResult

type SecretsProvider

type SecretsProvider interface {
	SecretWords() []string
}

func SecretsProviderFromCtx

func SecretsProviderFromCtx(ctx context.Context) SecretsProvider

type SecretsStaticProvider

type SecretsStaticProvider struct {
	xsync.Mutex
	SecretWordValues []string
}

func NewStaticSecretsProvider

func NewStaticSecretsProvider() *SecretsStaticProvider

func (*SecretsStaticProvider) ParseSecretsFrom

func (sp *SecretsStaticProvider) ParseSecretsFrom(obj any)

func (*SecretsStaticProvider) SecretWords

func (sp *SecretsStaticProvider) SecretWords() []string

func (*SecretsStaticProvider) SetSecretWords

func (sp *SecretsStaticProvider) SetSecretWords(v []string)

type StructFieldSecretsFilter

type StructFieldSecretsFilter struct{}

func (StructFieldSecretsFilter) ProcessInput

func (StructFieldSecretsFilter) ProcessInput(
	_ belt.TraceIDs,
	_ logger.Level,
	args ...any,
) loggertypes.PreHookResult

func (StructFieldSecretsFilter) ProcessInputFields

func (StructFieldSecretsFilter) ProcessInputFields(
	_ belt.TraceIDs,
	_ logger.Level,
	message string,
	fields field.AbstractFields,
) loggertypes.PreHookResult

func (StructFieldSecretsFilter) ProcessInputf

func (StructFieldSecretsFilter) ProcessInputf(
	_ belt.TraceIDs,
	_ logger.Level,
	format string,
	args ...any,
) loggertypes.PreHookResult

Jump to

Keyboard shortcuts

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