lokiwriter

package
v0.0.0-...-d931726 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package lokiwriter implements rogu.Writer to push logs to a Grafana Loki instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Address  string            `json:"address"`
	Username string            `json:"username"`
	Password string            `json:"password"`
	Labels   map[string]string `json:"labels"`
}

Options holds connection and authentication information for the loki connection.

type Writer

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

Writer implements rogu.Writer for pusing logs to a loki instance.

func NewWriter

func NewWriter(options Options) (t *Writer, err error)

NewWriter creates a new loki Writer with the given connection options.

func (Writer) Close

func (t Writer) Close() error

func (Writer) Write

func (t Writer) Write(
	lvl level.Level,
	fields []*rogu.Field,
	tag string,
	err error,
	errFormat string,
	callerFile string,
	callerLine int,
	msg string,
) error

Jump to

Keyboard shortcuts

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