Documentation ¶
Overview ¶
Package apcupsdexporter provides the Exporter type used in the apcupsd_exporter Prometheus exporter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFunc ¶
A ClientFunc is a function which can return an apcupsd NIS client. ClientFuncs are invoked on each Prometheus scrape, so that connections can be short-lived and less likely to time out or fail.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
An Exporter is a Prometheus exporter for apcupsd metrics. It wraps all apcupsd metrics collectors and provides a single global exporter which can serve metrics.
It implements the prometheus.Collector interface in order to register with Prometheus.
func New ¶
func New(fn ClientFunc) *Exporter
New creates a new Exporter which collects metrics by creating a apcupsd client using the input ClientFunc.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect sends the collected metrics from each of the collectors to prometheus.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe sends all the descriptors of the collectors included to the provided channel.
type StatusSource ¶
A StatusSource is a type which can retrieve UPS status information from apcupsd. It is implemented by *apcupsd.Client.
type UPSCollector ¶
type UPSCollector struct { Info *prometheus.Desc UPSLoadPercent *prometheus.Desc BatteryChargePercent *prometheus.Desc LineVolts *prometheus.Desc LineNominalVolts *prometheus.Desc OutputVolts *prometheus.Desc BatteryVolts *prometheus.Desc BatteryNominalVolts *prometheus.Desc BatteryNumberTransfersTotal *prometheus.Desc BatteryTimeLeftSeconds *prometheus.Desc BatteryTimeOnSeconds *prometheus.Desc BatteryCumulativeTimeOnSecondsTotal *prometheus.Desc LastTransferOnBatteryTimeSeconds *prometheus.Desc LastTransferOffBatteryTimeSeconds *prometheus.Desc LastSelftestTimeSeconds *prometheus.Desc NominalPowerWatts *prometheus.Desc InternalTemperatureCelsius *prometheus.Desc // contains filtered or unexported fields }
A UPSCollector is a Prometheus collector for metrics regarding an APC UPS.
func NewUPSCollector ¶
func NewUPSCollector(ss StatusSource) *UPSCollector
NewUPSCollector creates a new UPSCollector.
func (*UPSCollector) Collect ¶
func (c *UPSCollector) Collect(ch chan<- prometheus.Metric)
Collect sends the metric values for each metric created by the UPSCollector to the provided prometheus Metric channel.
func (*UPSCollector) Describe ¶
func (c *UPSCollector) Describe(ch chan<- *prometheus.Desc)
Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
apcupsd_exporter
Command apcupsd_exporter provides a Prometheus exporter for apcupsd.
|
Command apcupsd_exporter provides a Prometheus exporter for apcupsd. |