logs

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DedupStrategy

type DedupStrategy string

DedupStrategy represents a deduplication strategy.

const (
	None      DedupStrategy = "none"
	Exact     DedupStrategy = "exact"
	Numbers   DedupStrategy = "numbers"
	Signature DedupStrategy = "signature"
)

type Logs

type Logs struct {
	Builder *sdk.Panel
}

Logs represents a logs panel.

func New

func New(title string, options ...Option) (*Logs, error)

New creates a new logs panel.

type Option

type Option func(logs *Logs) error

Option represents an option that can be used to configure a logs panel.

func CommonLabels

func CommonLabels() Option

CommonLabels displays the "common labels".

func DataSource

func DataSource(source string) Option

DataSource sets the data source to be used by the panel.

func Deduplication

func Deduplication(dedup DedupStrategy) Option

Deduplication sets the deduplication strategy.

func Description

func Description(content string) Option

Description annotates the current visualization with a human-readable description.

func Height

func Height(height string) Option

Height sets the height of the panel, in pixels. Example: "400px".

func HideLogDetails

func HideLogDetails() Option

HideLogDetails disables the log details view for each log row.

func Links(panelLinks ...links.Link) Option

Links adds links to be displayed on this panel.

func Order

func Order(order SortOrder) Option

Order display results in descending or ascending time order. The default is Descending, showing the newest logs first. Set to Ascending to show the oldest log lines first.

func PrettifyJSON

func PrettifyJSON() Option

PrettifyJSON pretty prints all JSON logs. This setting does not affect logs in any format other than JSON.

func Repeat

func Repeat(repeat string) Option

Repeat configures repeating a panel for a variable

func RepeatDirection added in v0.22.0

func RepeatDirection(direction sdk.RepeatDirection) Option

RepeatDirection configures repeating vertical or horizontal

func Span

func Span(span float32) Option

Span sets the width of the panel, in grid units. Should be a positive number between 1 and 12. Example: 6.

func Time

func Time() Option

Time displays the "time" column. This is the timestamp associated with the log line as reported from the data source.

func Transparent

func Transparent() Option

Transparent makes the background transparent.

func UniqueLabels

func UniqueLabels() Option

UniqueLabels displays the "unique labels" column, which shows only non-common labels.

func WithLokiTarget

func WithLokiTarget(query string, options ...loki.Option) Option

WithLokiTarget adds a loki query to the graph.

func WrapLines

func WrapLines() Option

WrapLines enables line wrapping.

type SortOrder

type SortOrder string

SortOrder represents a sort order.

const (
	Asc  SortOrder = "Ascending"
	Desc SortOrder = "Descending"
)

Jump to

Keyboard shortcuts

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