Documentation ¶
Overview ¶
Package loki provides a simple best-effort loki log ingestion client supporting batch sends. It is heavily based on https://github.com/grafana/loki/tree/main/clients/pkg/promtail/client.
It is best-effort, meaning it doesn't provide delivery guarantees, it will drop logs if loki isn't accessible. It is meant to be used in local dev environments or where log delivery isn't critical.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for pushing logs in snappy-compressed protos over HTTP.
func (*Client) Run ¶
func (c *Client) Run()
Run blocks until Stop is called.
- It batches and sends logs to loki.
- It sends logs every batchWait time.
- Failed sends are retried.
- Enqueue logs are dropped if BatchMax is reached.
- It tries to send the last batch when Stop is called. It doesn't retry this batch.
Click to show internal directories.
Click to hide internal directories.