decorate

package
v0.0.0-...-edcf33a Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain []Decorator

Chain of decorators to be applied to the metric family

func (Chain) Decorate

func (c Chain) Decorate(mfs []*dto.MetricFamily)

Decorate the metric family

func (Chain) Name

func (c Chain) Name() string

Name is the name of the decorator

type Decorator

type Decorator interface {
	Decorate([]*dto.MetricFamily)
	Name() string
}

Decorator decorates a list of metric families

type LabelAppender

type LabelAppender []*dto.LabelPair

LabelAppender is a list of label pairs that need to be added on all metrics

func (LabelAppender) Decorate

func (l LabelAppender) Decorate(mfs []*dto.MetricFamily)

Decorate adds metric labels from its list

func (LabelAppender) Name

func (LabelAppender) Name() string

Name is the name of this decorator

type LowercaseNames

type LowercaseNames struct{}

LowercaseNames decorates metrics to be have all lowercase label names

func (LowercaseNames) Decorate

func (LowercaseNames) Decorate(mfs []*dto.MetricFamily)

Decorate decorates the provided metrics for compatibility

func (LowercaseNames) Name

func (LowercaseNames) Name() string

Name is the name of this decorator

type TopK

type TopK struct {
	K uint
	N string
}

TopK is a decorator that removes metrics not in the top K by value

func (TopK) Decorate

func (t TopK) Decorate(mfs []*dto.MetricFamily)

Decorate removes all but the top K metrics for a given metric name

func (TopK) Name

func (t TopK) Name() string

Name is the name of this decorator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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