client

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(cfg *config.Config, logger log.Logger) (types.LokiClient, error)

NewClient creates a new client based on the fluentbit configuration.

func NewPromtailClient

func NewPromtailClient(cfg client.Config, logger log.Logger) (types.LokiClient, error)

NewPromtailClient return promtail client which increments the ForwardedLogs counter on successful call of the Handle function

func NewRemoveTenantIdClient added in v0.36.0

func NewRemoveTenantIdClient(clientToWrap types.LokiClient) types.LokiClient

NewRemoveTenantIdClient return loki client wich removes the __tenant_id__ value fro the label set

Types

type Entry added in v0.37.0

type Entry struct {
	Labels model.LabelSet
	logproto.Entry
}

type FakeLokiClient added in v0.37.0

type FakeLokiClient struct {
	IsStopped           bool
	IsGracefullyStopped bool
	Entries             []Entry
}

func (*FakeLokiClient) Handle added in v0.37.0

func (c *FakeLokiClient) Handle(labels model.LabelSet, timestamp time.Time, line string) error

func (*FakeLokiClient) Stop added in v0.37.0

func (c *FakeLokiClient) Stop()

func (*FakeLokiClient) StopWait added in v0.37.0

func (c *FakeLokiClient) StopWait()

type LokiClient added in v0.36.0

type LokiClient interface {
	Handle(labels model.LabelSet, time time.Time, entry string) error
	// Stop shut down the client immediately without waiting to send the saved logs
	Stop()
	// StopWait stops the client of receiving new logs and waits all saved logs to be sent until shuting down
	StopWait()
}

Jump to

Keyboard shortcuts

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