client

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 31 Imported by: 25

Documentation

Index

Constants

View Source
const (

	// Label reserved to override the tenant ID while processing
	// pipeline stages
	ReservedLabelTenantID = "__tenant_id__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	api.EntryHandler
	// Stop goroutine sending batch of entries.
	Stop()
}

Client pushes entries to Loki and can be stopped

func New

func New(cfg Config, logger log.Logger) (Client, error)

New makes a new Client.

func NewLogger added in v1.4.0

func NewLogger(log log.Logger, externalLabels lokiflag.LabelSet, cfgs ...Config) (Client, error)

NewLogger creates a new client logger that logs entries instead of sending them.

func NewMulti

func NewMulti(logger log.Logger, externalLabels flagext.LabelSet, cfgs ...Config) (Client, error)

NewMulti creates a new client

type Config

type Config struct {
	URL       flagext.URLValue
	BatchWait time.Duration
	BatchSize int

	Client config.HTTPClientConfig `yaml:",inline"`

	BackoffConfig util.BackoffConfig `yaml:"backoff_config"`
	// The labels to add to any time series or alerts when communicating with loki
	ExternalLabels lokiflag.LabelSet `yaml:"external_labels,omitempty"`
	Timeout        time.Duration     `yaml:"timeout"`

	// The tenant ID to use when pushing logs to Loki (empty string means
	// single tenant mode)
	TenantID string `yaml:"tenant_id"`
}

Config describes configuration for a HTTP pusher client.

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(flags *flag.FlagSet)

RegisterFlags registers flags.

func (*Config) RegisterFlagsWithPrefix added in v1.6.0

func (c *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlags with prefix registers flags where every name is prefixed by prefix. If prefix is a non-empty string, prefix should end with a period.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implement Yaml Unmarshaler

type MultiClient

type MultiClient []Client

MultiClient is client pushing to one or more loki instances.

func (MultiClient) Handle

func (m MultiClient) Handle(labels model.LabelSet, time time.Time, entry string) error

Handle Implements api.EntryHandler

func (MultiClient) Stop

func (m MultiClient) Stop()

Stop implements Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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