metrics

package
v0.0.0-...-93d971c Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMetricsListener

func StartMetricsListener(config MetricsConfig, log *logging.Logger) error

Types

type Exporter

type Exporter struct {
	Logger *logging.Logger

	URI string
	// contains filtered or unexported fields
}

Exporter collects HAProxy stats from the given URI and exports them using the prometheus metrics package.

func NewExporter

func NewExporter(log *logging.Logger, uri string, selectedServerMetrics map[int]*prometheus.GaugeVec, timeout time.Duration) (*Exporter, error)

NewExporter returns an initialized Exporter.

func (*Exporter) Collect

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

Collect fetches the stats from configured HAProxy location and delivers them as Prometheus metrics. It implements prometheus.Collector.

func (*Exporter) Describe

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

Describe describes all the metrics ever exported by the HAProxy exporter. It implements prometheus.Collector.

type MetricsConfig

type MetricsConfig struct {
	ProjectName    string
	ProjectVersion string
	ProjectBuild   string

	Host          string
	Port          int
	HaproxyCSVURI string
}

Jump to

Keyboard shortcuts

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