promtail

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const LOG_ENTRIES_CHAN_SIZE = 5000

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	//	Debugf(format string, args ...interface{})
	Chan() chan<- *PromtailStream
	Single() chan<- *SingleEntry
	Shutdown()
	GetLocation() *time.Location
}

func NewClientJson

func NewClientJson(conf *ClientConfig) (Client, error)

func NewClientProto

func NewClientProto(conf *ClientConfig) (Client, error)

type ClientConfig

type ClientConfig struct {
	Name               string         // Label service_name will be added to the stream
	PushURL            string         // E.g. http://localhost:3100/api/prom/push
	TenantID           string         // will be sent to LOKI as X-Scope-OrgID header, will be sat as fake in case of empty
	BatchWait          time.Duration  // Batch flush wait timeout
	BatchEntriesNumber int            // Batch buffer size
	Timeout            time.Duration  // HTTP Client Timeout !ToDo
	Location           *time.Location // time location provided by Stream, e.g. Europe/Moscow
}

type PromtailEntry

type PromtailEntry struct {
	Ts   time.Time
	Line string
}

Promtail common Logs entry format accepted by Chan() chan<- *PromtailStream

type PromtailStream

type PromtailStream struct {
	Labels  map[string]string
	Entries []*PromtailEntry
}

type SingleEntry

type SingleEntry struct {
	Labels map[string]string
	Ts     time.Time
	Line   string
}

Jump to

Keyboard shortcuts

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