gatherer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gatherer

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

func New

func New(gatherer prometheus.Gatherer, opt ...Option) *Gatherer

New creates a new Gatherer

func (*Gatherer) Close

func (input *Gatherer) Close() error

func (*Gatherer) Gather

func (input *Gatherer) Gather() ([]*types.Sample, error)

Gather gathers metrics

func (*Gatherer) GetInterval

func (input *Gatherer) GetInterval() time.Duration

GetInterval returns the interval of the input.

func (*Gatherer) Histogram

func (input *Gatherer) Histogram(metricName string, metric *dto.Metric, tags map[string]string) []*types.Sample

Histogram metric

func (*Gatherer) Init

func (input *Gatherer) Init() error

Init initializes the Gatherer

func (*Gatherer) Prefix

func (input *Gatherer) Prefix() string

Prefix returns the prefix of the input.

func (*Gatherer) Standard

func (input *Gatherer) Standard(metricName string, metric *dto.Metric, tags map[string]string) []*types.Sample

Standard metric

func (*Gatherer) String

func (input *Gatherer) String() string

String returns the string representation of the input.

func (*Gatherer) Summary

func (input *Gatherer) Summary(metricName string, metric *dto.Metric, tags map[string]string) []*types.Sample

Summary metric

type Option

type Option func(o *Options)

func WithIgnoreLabelKeys

func WithIgnoreLabelKeys(ignoreLabelKeys filter.Filter) Option

WithIgnoreLabelKeys sets the label keys of the gatherer

func WithIgnoreMetrics

func WithIgnoreMetrics(ignoreMetrics filter.Filter) Option

WithIgnoreMetrics sets the metrics of the gatherer

func WithInterval

func WithInterval(interval time.Duration) Option

WithInterval sets the interval of the gatherer

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix sets the prefix of the gatherer

func WithTags

func WithTags(tags map[string]string) Option

WithTags sets the tags of the gatherer

type Options

type Options struct {
	Gatherer        prometheus.Gatherer
	Prefix          string
	IgnoreMetrics   filter.Filter
	IgnoreLabelKeys filter.Filter
	Tags            map[string]string
	Interval        time.Duration
}

Jump to

Keyboard shortcuts

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