reader

package
v0.0.0-...-e951c9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LokiReader

type LokiReader interface {
	Query(start time.Time, end time.Time) ([]time.Time, error)
	QueryCountOverTime(queryRange string) (float64, error)
}

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(writer io.Writer,
	receivedChan chan time.Time,
	useTLS bool,
	tlsConfig *tls.Config,
	caFile string,
	address string,
	user string,
	pass string,
	tenantID string,
	queryTimeout time.Duration,
	labelName string,
	labelVal string,
	streamName string,
	streamValue string,
	interval time.Duration,
) (*Reader, error)

func (*Reader) Query

func (r *Reader) Query(start time.Time, end time.Time) ([]time.Time, error)

Query will ask Loki for all canary timestamps in the requested timerange. Query blocks if a previous query has failed until the appropriate backoff time has been reached.

func (*Reader) QueryCountOverTime

func (r *Reader) QueryCountOverTime(queryRange string) (float64, error)

QueryCountOverTime will ask Loki for a count of logs over the provided range e.g. 5m QueryCountOverTime blocks if a previous query has failed until the appropriate backoff time has been reached.

func (*Reader) Stop

func (r *Reader) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL