collector

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analytics

type Analytics struct {
	AzionClient *azion.Client
	Metrics     []Metric
}

Analytics keeps the collector info

func NewCollectorAnalytics

func NewCollectorAnalytics(aCli *azion.Client, msEnabled ...string) (*Analytics, error)

NewCollectorAnalytics return the CollectorAnalytics object

func (*Analytics) InitCollectorsUpdater

func (ca *Analytics) InitCollectorsUpdater()

InitCollectorsUpdater start the paralel auto update for each collector

func (*Analytics) InitMetrics

func (ca *Analytics) InitMetrics(msEnabled ...string) error

InitMetrics initialize a list of metrics names and return error if fails.

func (*Analytics) Update

func (ca *Analytics) Update(ch chan<- prometheus.Metric) error

Update implements Collector and exposes related metrics

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.

type CollectorMaster

type CollectorMaster struct {
	Collectors  map[string]Collector
	AzionClient *azion.Client
}

CollectorMaster implements the prometheus.Collector interface.

func NewCollectorMaster

func NewCollectorMaster(azionCli *azion.Client, metrics ...string) (*CollectorMaster, error)

NewCollectorMaster creates a new NodeCollector.

func (*CollectorMaster) Collect

func (cm *CollectorMaster) Collect(ch chan<- prometheus.Metric)

Collect implements required collect function for all promehteus collectors

func (*CollectorMaster) Describe

func (cm *CollectorMaster) Describe(ch chan<- *prometheus.Desc)

Describe is a Prometheus implementation to be called by collector. It essentially writes all descriptors to the prometheus desc channel.

type Metric

type Metric struct {
	Prom        *prometheus.Desc
	Name        string
	Description string

	Value       float64
	Labels      []string
	LabelsValue []string
	LabelsConst prometheus.Labels
	// contains filtered or unexported fields
}

Metric describe the metric attributes

Jump to

Keyboard shortcuts

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