loki

package
v0.0.0-...-0941746 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

func NewWriter

func NewWriter(ctx context.Context, lokiEndpoint string, streams map[string]string, options *WriterOptions) *Writer

func (*Writer) SetEndpoint

func (writer *Writer) SetEndpoint(lokiEndpoint string)

SetEndpoint sets the loki endpoint. This method IS NOT thread safe. It should be used just after config is loaded

func (*Writer) Write

func (writer *Writer) Write(data []byte) (n int, err error)

type WriterOptions

type WriterOptions struct {
	LokiEndpoint string
	// ChildWriter is used to pass logs to another writer
	// default: os.Stdout
	ChildWriter io.Writer
	// DefaultRecordsBufferSize is your expected number of `(logs per second) / (1000 / FlushTimeout)`
	// default: 100
	DefaultRecordsBufferSize uint32
	// EmptyEndpointMaxBufferSize is the number of logs to buffer if LokiEndpoint == "".
	// it's useful if you log a few things before your config with the loki endpoint is full loaded
	// default: 200
	EmptyEndpointMaxBufferSize uint32
	// FlushTimeout in ms
	// default: 200
	FlushTimeout uint32
}

Jump to

Keyboard shortcuts

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