edgemax_exporter

package module
v0.0.0-...-7c86f50 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2018 License: MIT Imports: 5 Imported by: 0

README

EdgeMAX Exporter for Prometheus

This is a simple server that scrapes EdgeMAX stats and exports them via HTTP for Prometheus consumption.

Rewriting of mdlayher/edgemax_exporter (archived repo) with gorilla/websocket implementation.

Getting started

To run it:

./edgemax_exporter [flags]

Help on flags:

./edgemax_exporter --help

Running tests

go test ./...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

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

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(client *edgemax.Client) (*Exporter, func(), error)

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

func (*Exporter) Collect

func (e *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 (e *Exporter) Describe(ch chan<- *prometheus.Desc)

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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