loki

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps Loki HTTP API

func NewClient

func NewClient(baseURL string) (*Client, error)

NewClient creates a new Loki client

func NewProbeClient added in v0.35.0

func NewProbeClient(baseURL string) (*Client, error)

NewProbeClient creates a Loki client with a short timeout for connectivity checks

func (*Client) LabelValues

func (c *Client) LabelValues(label, query string) ([]string, error)

LabelValues returns all values for a given label If query is non-empty, values are scoped to streams matching the query selector

func (*Client) Labels

func (c *Client) Labels(query string) ([]string, error)

Labels returns all label names from Loki If query is non-empty, labels are scoped to streams matching the query selector

func (*Client) Query

func (c *Client) Query(query string, start, end time.Time, limit int) ([]QueryResult, error)

Query executes a LogQL query and returns log entries

func (*Client) TestConnection

func (c *Client) TestConnection() error

TestConnection verifies the Loki connection is working

type QueryResult

type QueryResult struct {
	Timestamp time.Time
	Labels    map[string]string
	Line      string
}

QueryResult represents a single log entry

Jump to

Keyboard shortcuts

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