Documentation
¶
Index ¶
- Constants
- type LokiLogger
- func (c *LokiLogger) DiscoverLokiServer(ctx context.Context, log zerolog.Logger) error
- func (c *LokiLogger) SetLokiServer(host string, port int, secure bool)
- func (c *LokiLogger) SetTimeoffset(timeOffset int64)
- func (c *LokiLogger) Shutdown()
- func (l *LokiLogger) Write(p []byte) (int, error)
- func (l *LokiLogger) WriteLevel(level zerolog.Level, p []byte) (n int, err error)
- type LokiProxy
- type PushRequest
- type StreamAdapter
Constants ¶
View Source
const LOG_ENTRIES_CHAN_SIZE = 5000
View Source
const (
LokiPushPath = "/loki/api/v1/push"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LokiLogger ¶
type LokiLogger struct {
// contains filtered or unexported fields
}
LokiLogger send log messages towards Loki.
func NewLokiLogger ¶
func NewLokiLogger(rootUrl, job string, timeOffset int64) (*LokiLogger, error)
func (*LokiLogger) DiscoverLokiServer ¶ added in v1.12.1
DiscoverLokiServer automatically updates Loki URL when loki service on mDNS changes. Runs until context is canceled.
func (*LokiLogger) SetLokiServer ¶ added in v1.12.1
func (c *LokiLogger) SetLokiServer(host string, port int, secure bool)
SetLokiServer updates the URL to push logs to.
func (*LokiLogger) SetTimeoffset ¶ added in v0.14.0
func (c *LokiLogger) SetTimeoffset(timeOffset int64)
Set the timeoffset in seconds
func (*LokiLogger) Shutdown ¶
func (c *LokiLogger) Shutdown()
func (*LokiLogger) WriteLevel ¶
Write a message with given level
type LokiProxy ¶ added in v1.12.1
type LokiProxy struct {
// contains filtered or unexported fields
}
func NewLokiProxy ¶ added in v1.12.1
NewLokiProxy constructs a new loki proxy that forwards loki push requests to the given host:port.
func (*LokiProxy) HandlePushRequest ¶ added in v1.12.1
func (lp *LokiProxy) HandlePushRequest(resp http.ResponseWriter, req *http.Request)
HandlePushRequest receives a standard Loki push request, updates all time entries and forwards the request to the configure loki URL.
type PushRequest ¶ added in v0.12.3
type PushRequest struct {
Streams []StreamAdapter `json:"streams"`
}
type StreamAdapter ¶ added in v0.12.3
Click to show internal directories.
Click to hide internal directories.