Documentation
¶
Overview ¶
This file was copied from the credativ/vali project https://github.com/credativ/vali/blob/v2.2.4/cmd/fluent-bit/buffer.go
Modifications Copyright SAP SE or an SAP affiliate company and Gardener contributors ¶
This file was copied from the credativ/vali project https://github.com/credativ/vali/blob/v2.2.4/cmd/fluent-bit/dque.go
Modifications Copyright SAP SE or an SAP affiliate company and Gardener contributors
Index ¶
- Variables
- type Entry
- type FakeValiClient
- type NewValiClientFunc
- type Options
- type OutputClient
- func NewBuffer(cfg config.Config, logger log.Logger, ...) (OutputClient, error)
- func NewBufferDecorator(cfg config.Config, newClientFunc NewValiClientFunc, logger log.Logger) (OutputClient, error)
- func NewClient(cfg config.Config, opts ...Options) (OutputClient, error)
- func NewDque(cfg config.Config, logger log.Logger, ...) (OutputClient, error)
- func NewPackClientDecorator(cfg config.Config, newClient NewValiClientFunc, logger log.Logger) (OutputClient, error)
- func NewPromtailClient(cfg client.Config, logger log.Logger) (OutputClient, error)
- func NewSortedClientDecorator(cfg config.Config, newClient NewValiClientFunc, logger log.Logger) (OutputClient, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidLabelType = errors.New("labels are not a valid model.LabelSet")
ErrInvalidLabelType is returned when the provided labels are not of type model.LabelSet
Functions ¶
This section is empty.
Types ¶
type FakeValiClient ¶ added in v0.53.0
type FakeValiClient struct {
// IsStopped show whether the client is stopped or not
IsStopped bool
// IsGracefullyStopped show whether the client is gracefully topped or not
IsGracefullyStopped bool
// Entries is slice of all received entries
Entries []Entry
Mu sync.Mutex
}
FakeValiClient mocks OutputClient
func (*FakeValiClient) GetEndPoint ¶ added in v0.55.1
func (*FakeValiClient) GetEndPoint() string
GetEndPoint returns the target logging backend endpoint
func (*FakeValiClient) Stop ¶ added in v0.53.0
func (c *FakeValiClient) Stop()
Stop stops the client
func (*FakeValiClient) StopWait ¶ added in v0.53.0
func (c *FakeValiClient) StopWait()
StopWait gracefully stops the client
type NewValiClientFunc ¶ added in v0.53.0
NewValiClientFunc returns a OutputClient on success.
type Options ¶ added in v0.43.0
type Options interface {
// contains filtered or unexported methods
}
Options defines functional options for creating clients
func WithLogger ¶ added in v0.69.0
WithLogger creates a functional option for setting the logger
func WithPreservedLabels ¶ added in v0.69.0
WithPreservedLabels creates a functional option for preserved labels (Vali only)
type OutputClient ¶ added in v0.68.0
type OutputClient interface {
// Handle processes logs and then sends them to Vali ingester
Handle(labels any, t 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 shutting down
StopWait()
// GetEndPoint returns the target logging backend endpoint
GetEndPoint() string
}
OutputClient represents an instance which sends logs to Vali ingester
func NewBuffer ¶ added in v0.55.1
func NewBuffer(cfg config.Config, logger log.Logger, newClientFunc func(cfg config.Config, logger log.Logger) (OutputClient, error)) (OutputClient, error)
NewBuffer makes a new buffered Client.
func NewBufferDecorator ¶ added in v0.43.0
func NewBufferDecorator(cfg config.Config, newClientFunc NewValiClientFunc, logger log.Logger) (OutputClient, error)
NewBufferDecorator makes a new buffered Client.
func NewClient ¶
func NewClient(cfg config.Config, opts ...Options) (OutputClient, error)
NewClient creates a new client based on the fluent-bit configuration.
func NewDque ¶ added in v0.55.1
func NewDque(cfg config.Config, logger log.Logger, newClientFunc func(cfg config.Config, logger log.Logger) (OutputClient, error)) (OutputClient, error)
NewDque makes a new dque vali client
func NewPackClientDecorator ¶ added in v0.43.0
func NewPackClientDecorator(cfg config.Config, newClient NewValiClientFunc, logger log.Logger) (OutputClient, error)
NewPackClientDecorator return vali client which pack all the labels except the explicitly excluded ones and forward them the the wrapped client.
func NewPromtailClient ¶
NewPromtailClient return OutputClient which wraps the original Promtail client. It increments the ForwardedLogs counter on successful call of the Handle function. !!!This must be the bottom wrapper!!!
func NewSortedClientDecorator ¶ added in v0.43.0
func NewSortedClientDecorator(cfg config.Config, newClient NewValiClientFunc, logger log.Logger) (OutputClient, error)
NewSortedClientDecorator returns client which sorts the logs based their timestamp.