exporter

package
v0.0.0-...-75cf725 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package exporter provides the Exporter type used in the edgemax_exporter Prometheus exporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DPICollector

type DPICollector struct {
	ReceivedBytes    *prometheus.GaugeVec
	TransmittedBytes *prometheus.GaugeVec
	// contains filtered or unexported fields
}

A DPICollector is a Prometheus collector for metrics regarding EdgeMAX deep packet inspection statistics.

func NewDPICollector

func NewDPICollector(statC <-chan edgemax.DPIStats) *DPICollector

NewDPICollector creates a new DPICollector.

func (*DPICollector) Collect

func (c *DPICollector) Collect(ch chan<- prometheus.Metric)

Collect sends the metric values for each metric pertaining to deep packet inspection to the provided prometheus Metric channel.

func (*DPICollector) Describe

func (c *DPICollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.

type Exporter

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

An Exporter is a Prometheus exporter for Ubiquiti UniFi Controller API metrics. It wraps all UniFi metrics collectors and provides a single global exporter which can serve metrics. It also ensures that the collection is done in a thread-safe manner, the necessary requirement stated by Prometheus. It implements the prometheus.Collector interface in order to register with Prometheus.

func New

func New(c *edgemax.Client) (*Exporter, func() error, error)

New creates a new Exporter which collects metrics from one or mote sites.

func (*Exporter) Collect

func (c *Exporter) Collect(ch chan<- prometheus.Metric)

Collect sends the collected metrics from each of the collectors to prometheus. Collect could be called several times concurrently and thus its run is protected by a single mutex.

func (*Exporter) Describe

func (c *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe sends all the descriptors of the collectors included to the provided channel.

type InterfacesCollector

type InterfacesCollector struct {
	ReceivedBytes    *prometheus.GaugeVec
	TransmittedBytes *prometheus.GaugeVec
	// contains filtered or unexported fields
}

A InterfacesCollector is a Prometheus collector for metrics regarding Ubiquiti UniFi devices.

func NewInterfacesCollector

func NewInterfacesCollector(statC <-chan edgemax.Interfaces) *InterfacesCollector

NewInterfacesCollector creates a new InterfacesCollector which collects metrics for a specified site.

func (*InterfacesCollector) Collect

func (c *InterfacesCollector) Collect(ch chan<- prometheus.Metric)

Collect sends the metric values for each metric pertaining to the global cluster usage over to the provided prometheus Metric channel.

func (*InterfacesCollector) Describe

func (c *InterfacesCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.

type SystemCollector

type SystemCollector struct {
	CPUPercent    prometheus.Gauge
	UptimeSeconds prometheus.Gauge
	MemoryPercent prometheus.Gauge
	// contains filtered or unexported fields
}

A SystemCollector is a Prometheus collector for metrics regarding Ubiquiti UniFi devices.

func NewSystemCollector

func NewSystemCollector(statC <-chan *edgemax.SystemStats) *SystemCollector

NewSystemCollector creates a new SystemCollector which collects metrics for a specified site.

func (*SystemCollector) Collect

func (c *SystemCollector) Collect(ch chan<- prometheus.Metric)

Collect sends the metric values for each metric pertaining to the global cluster usage over to the provided prometheus Metric channel.

func (*SystemCollector) Describe

func (c *SystemCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.

Jump to

Keyboard shortcuts

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