Documentation
¶
Index ¶
- func SetLokiOutPut()
- func WithErrorCallback(errorHandler func(err error)) clientOption
- func WithSendBatchSize(batchSize uint) clientOption
- func WithSendBatchTimeout(sendTimeout time.Duration) clientOption
- type Client
- type LogEntry
- type LogStream
- type PongResponse
- type PromtailHook
- type StreamsExchanger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLokiOutPut ¶
func SetLokiOutPut()
func WithErrorCallback ¶
func WithErrorCallback(errorHandler func(err error)) clientOption
func WithSendBatchSize ¶
func WithSendBatchSize(batchSize uint) clientOption
func WithSendBatchTimeout ¶
Types ¶
type Client ¶
type Client interface {
Logf(format string, e *logrus.Entry)
LogfWithLabels(labels map[string]string, format []string)
Ping() (*PongResponse, error)
Close()
}
type PongResponse ¶
type PongResponse struct {
IsReady bool
}
type PromtailHook ¶
func NewPromtailHook ¶
func NewPromtailHook(lokiURL string, labels map[string]string) (*PromtailHook, error)
Initializes a Promtail hook for Logrus logger.
- lokiAddress - address of Grafana Loki server to push logs to (e.g. loki:3100)
- labels - is kinda tags for grepping in Loki's and Grafana's queries
func (*PromtailHook) Levels ¶
func (rcv *PromtailHook) Levels() []logrus.Level
func (*PromtailHook) LokiHealthCheck ¶
func (rcv *PromtailHook) LokiHealthCheck() error
type StreamsExchanger ¶
type StreamsExchanger interface {
Push(streams []*LogStream) error
Ping() (*PongResponse, error)
}
func NewJSONv1Exchanger ¶
func NewJSONv1Exchanger(lokiAddress string) StreamsExchanger
Creates a client with direct send logic (nor batch neither queue) capable to exchange with Loki v1 API via JSON
Read more at: https://github.com/grafana/loki/blob/master/docs/api.md#post-lokiapiv1push
Click to show internal directories.
Click to hide internal directories.