logs

package
v0.0.0-...-b1c89d2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package logs represents the reader and writer interface to query and push logs to Loki for a set of labels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

func Query(
	ctx context.Context,
	l log.Logger,
	endpoint *url.URL,
	t auth.TokenProvider,
	q options.Query,
	tls options.TLS,
	defaultStep time.Duration,
) (int, promapiv1.Warnings, error)

func Read

func Read(
	ctx context.Context,
	endpoint *url.URL,
	tp auth.TokenProvider,
	labels []prompb.Label,
	ago, latency time.Duration,
	m instr.Metrics,
	l log.Logger,
	tls options.TLS,
) (int, error)

Read executes query against Loki with the same labels to retrieve the written logs back.

func Write

func Write(ctx context.Context, endpoint *url.URL, t auth.TokenProvider, wreq *PushRequest, l log.Logger, tls options.TLS) (int, error)

Write executes a push against Loki sending a set of labels and log entries to store.

Types

type PushRequest

type PushRequest struct {
	Streams []stream `json:"streams"`
}

PushRequest represents the payload to push logs to Loki.

func Generate

func Generate(labels []prompb.Label, values [][]string) *PushRequest

Generate takes a set of labels and log lines and returns the payload to push logs to Loki.

Jump to

Keyboard shortcuts

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