client

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultTypeStream = "streams"
)

ResultType values

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Address string
}

Client holds configuration for the loki

func (*Client) QueryRange

func (c *Client) QueryRange(ctx context.Context, queryStr string, limit int, start, end time.Time, direction string, step, interval time.Duration, quiet bool) (*QueryResponse, error)

QueryRange queries Loki in a given time range.

type Entry

type Entry struct {
	Timestamp time.Time
	Line      string
}

Entry represents a log entry. It includes a log message and the time it occurred at. From: https://github.com/grafana/loki/blob/d9380eaac950c669864c0af60fd99eae281d2438/pkg/loghttp/entry.go

type LabelSet

type LabelSet map[string]string

LabelSet is a key/value pair mapping of labels From: https://github.com/grafana/loki/blob/d9380eaac950c669864c0af60fd99eae281d2438/pkg/loghttp/labels.go

type QueryResponse

type QueryResponse struct {
	Status string            `json:"status"`
	Data   QueryResponseData `json:"data"`
}

QueryResponse represents the http json response to a Loki range and instant query From: https://github.com/grafana/loki/blob/a9d85de4aa5290cf2f8b2dca5d08645bbd0dc66c/pkg/loghttp/query.go

type QueryResponseData

type QueryResponseData struct {
	ResultType ResultType  `json:"resultType"`
	Result     ResultValue `json:"result"`
}

QueryResponseData represents the http json response to a label query From: https://github.com/grafana/loki/blob/a9d85de4aa5290cf2f8b2dca5d08645bbd0dc66c/pkg/loghttp/query.go

func (*QueryResponseData) UnmarshalJSON

func (q *QueryResponseData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. From: https://github.com/grafana/loki/blob/a9d85de4aa5290cf2f8b2dca5d08645bbd0dc66c/pkg/loghttp/query.go

type ResultType

type ResultType string

ResultType holds the type of the result

type ResultValue

type ResultValue interface {
	Type() ResultType
}

ResultValue interface mimics the promql.Value interface From: https://github.com/grafana/loki/blob/a9d85de4aa5290cf2f8b2dca5d08645bbd0dc66c/pkg/loghttp/query.go

type Stream

type Stream struct {
	Labels  LabelSet `json:"stream"`
	Entries []Entry  `json:"values"`
}

Stream represents a log stream. It includes a set of log entries and their labels. From: https://github.com/grafana/loki/blob/a9d85de4aa5290cf2f8b2dca5d08645bbd0dc66c/pkg/loghttp/query.go

Jump to

Keyboard shortcuts

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