collector

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package collector includes all individual collectors to gather and export system metrics.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func DisableDefaultCollectors

func DisableDefaultCollectors()

DisableDefaultCollectors sets the collector state to false for all collectors which have not been explicitly enabled on the command line.

func IsNoDataError

func IsNoDataError(err error) bool

Types

type Collector

type Collector interface {
	// Get new metrics and expose them via prometheus registry.
	Update(ch chan<- prometheus.Metric) error
}

Collector is the interface a collector has to implement.

func NewNFTablesCollector

func NewNFTablesCollector(logger log.Logger) (Collector, error)

NewNFTablesCollector returns a new Collector exposing IpTables stats.

type MainCollector

type MainCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

MainCollector implements the prometheus.Collector interface.

func NewMainCollector

func NewMainCollector(logger log.Logger, filters ...string) (*MainCollector, error)

NewMainCollector creates a new MainCollector.

func (MainCollector) Collect

func (n MainCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (MainCollector) Describe

func (n MainCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

Jump to

Keyboard shortcuts

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