lokihttp

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Label reserved to override the tenant ID while processing
	// pipeline stages
	ReservedLabelTenantID = "__tenant_id__"

	LatencyLabel = "filename"
	HostLabel    = "host"
)

Variables

View Source
var UserAgent = fmt.Sprintf("grafana/%s", setting.BuildVersion)

Functions

This section is empty.

Types

type Client

type Client interface {
	Chan() chan<- Entry

	Stop()
	StopNow()
}

Client pushes entries to Loki and can be stopped

func New

func New(reg prometheus.Registerer, cfg Config, logger log.Logger) (Client, error)

New makes a new Client.

func NewWithTripperware

func NewWithTripperware(reg prometheus.Registerer, cfg Config, logger log.Logger, tp Tripperware) (Client, error)

NewWithTripperware creates a new Loki client with a custom tripperware.

type Config

type Config struct {
	URL       flagext.URLValue
	BatchWait time.Duration
	BatchSize int

	Client config.HTTPClientConfig

	BackoffConfig backoff.Config
	Timeout       time.Duration

	TenantID string
}

Config describes configuration for a HTTP pusher client.

type Entry

type Entry struct {
	Labels model.LabelSet
	logproto.Entry
}

Entry is a log entry with labels.

type Fake

type Fake struct {
	Labels model.LabelSet
	Entry  string
	// contains filtered or unexported fields
}

func NewFake

func NewFake() *Fake

func (*Fake) Chan

func (c *Fake) Chan() chan<- Entry

func (*Fake) Stop

func (c *Fake) Stop()

func (*Fake) StopNow

func (c *Fake) StopNow()

type Tripperware

type Tripperware func(http.RoundTripper) http.RoundTripper

Tripperware can wrap a roundtripper.

Jump to

Keyboard shortcuts

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