logger

package
v0.0.74 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BatchSize     int           // Max number of logs to buffer before sending.
	FlushInterval time.Duration // Max time to wait before sending a batch.
	SendTimeout   time.Duration // timeout for the gRPC send operation, we need to think about this little more.
	QueueSize     int           // The size of the internal log entry queue.
}

Config holds the configuration for the telemetry logger.

type Logger

type Logger interface {
	Report(level gen.LogLevel, source string, msg string, err error, fields map[string]string)
	Stop()
}

Logger is the interface that collectors will use to report critical errors. It decouples the collectors from the concrete implementation.

func NewLogger

func NewLogger(
	ctx context.Context,
	client TelemetryLogSender,
	config Config,
	zapLogger *zap.Logger,
	defaultLogger logr.Logger,
) Logger

NewLogger creates and starts a new telemetry logger.

type TelemetryLogSender

type TelemetryLogSender interface {
	SendTelemetryLogs(
		ctx context.Context,
		in *gen.SendTelemetryLogsRequest,
	) (*gen.SendTelemetryLogsResponse, error)
}

MetricsCollectorClient defines the necessary gRPC method for sending logs. Forcefully had to do this as, was not fully convinced to put this in transport layer and cant use the DackerClient/DirectSender interface here for circular dependency

Jump to

Keyboard shortcuts

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