Documentation
¶
Index ¶
Constants ¶
View Source
const (
LogEntry = "%s %s\n"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntryWriter ¶
type EntryWriter interface {
// WriteEntry handles sending the log to the output
// To maintain consistent log timing, Write is expected to be non-blocking
WriteEntry(ts time.Time, entry string)
Stop()
}
type Push ¶
type Push struct {
// contains filtered or unexported fields
}
Push is a io.Writer, that writes given log entries by pushing directly to the given loki server URL. Each `Push` instance handles for a single tenant. No batching of log lines happens when sending to Loki.
func NewPush ¶
func NewPush(
lokiAddr, tenantID string,
timeout time.Duration,
cfg config.HTTPClientConfig,
labelName, labelValue string,
streamName, streamValue string,
useTLS bool,
tlsCfg *tls.Config,
caFile, certFile, keyFile string,
username, password string,
backoffCfg *backoff.Config,
logger log.Logger,
) (*Push, error)
NewPush creates an instance of `Push` which writes logs directly to given `lokiAddr`
func (*Push) Stop ¶
func (p *Push) Stop()
Stop will cancel any ongoing requests and stop the goroutine listening for requests
func (*Push) WriteEntry ¶
func (p *Push) WriteEntry(ts time.Time, e string)
WriteEntry implements EntryWriter
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
func NewStreamWriter ¶
func NewStreamWriter(w io.Writer, logger log.Logger) *StreamWriter
func (*StreamWriter) WriteEntry ¶
func (s *StreamWriter) WriteEntry(ts time.Time, entry string)
Click to show internal directories.
Click to hide internal directories.