promtail

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 15 Imported by: 0

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{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Shutdown()
	Sent() int
	Buffered() int
}

func NewClientJson

func NewClientJson(conf ClientConfig, parent *http.Client) (Client, error)

func NewClientProto

func NewClientProto(conf ClientConfig, parent *http.Client) (Client, error)

type ClientConfig

type ClientConfig struct {
	// E.g. http://localhost:3100/api/prom/push
	PushURL string
	// E.g. "{job=\"somejob\"}"
	Labels             LabelSet
	BatchWait          time.Duration
	BatchEntriesNumber int
	// Logs are sent to Promtail if the entry level is >= SendLevel
	SendLevel LogLevel
	// Logs are printed to stdout if the entry level is >= PrintLevel
	PrintLevel LogLevel
}

type LabelSet

type LabelSet map[string]string

func (LabelSet) Append

func (ls LabelSet) Append(label string, value string) LabelSet

func (LabelSet) Copy

func (ls LabelSet) Copy() LabelSet

func (LabelSet) String

func (ls LabelSet) String() string

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO  LogLevel = iota
	WARN  LogLevel = iota
	ERROR LogLevel = iota
	// Maximum level, disables sending or printing
	DISABLE LogLevel = iota
)

Jump to

Keyboard shortcuts

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