Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Log(ts time.Time, msg string, lables, metadata map[string]string) Flush(ctx context.Context) Shutdown(ctx context.Context) }
func NewClient ¶
func NewClient(endpoint string, o *ClientOptions) (Client, error)
Creates a loki client for v1 api with automatic batching. Endpoint example http://localhost:3100/loki/api/v1/push Options can be nil for default values
type ClientOptions ¶
type ClientOptions struct { // Default labels passed with each message DefaultLabels map[string]string // Max wait before sending batch BatchWait time.Duration // Max batch size BatchSize uint // Callback what called on every error occurred in sender. // Due to asynchronous nature of sender errors cant be suppied with return values/ ErrorCallback func(err error) // by default uses http.DefaultClient HTTPClient HTTPClient // User json instead of protobuf for log pushing UseJSON bool }
Click to show internal directories.
Click to hide internal directories.