Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
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(uri string, sslVerify, proxyFromEnv bool, selectedServerMetrics map[int]metricInfo, excludedServerStates string, 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 HAProxy ¶
type HAProxy struct {
config.PluginConfig
Instances []*Instance `toml:"instances"`
}
func (*HAProxy) GetInstances ¶
type Instance ¶
type Instance struct {
config.InstanceConfig
// URI on which to scrape HAProxy.
URI string `toml:"uri"`
// Flag that enables SSL certificate verification for the scrape URI
SSLVerify bool `toml:"ssl_verify"`
// Comma-separated list of exported server metrics. See http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.1
ServerMetricFields string `toml:"server_metric_fields"`
// Comma-separated list of exported server states to exclude. See https://cbonte.github.io/haproxy-dconv/1.8/management.html#9.1, field 17 status
ServerExcludeStates string `toml:"server_exclude_states"`
// Timeout for trying to get stats from HAProxy.
Timeout config.Duration `toml:"timeout"`
// Flag that enables using HTTP proxy settings from environment variables ($http_proxy, $https_proxy, $no_proxy)
HTTPProxyFromEnv bool `toml:"proxy_from_env"`
// contains filtered or unexported fields
}
func (*Instance) Gather ¶
func (ins *Instance) Gather(slist *types.SampleList)
Click to show internal directories.
Click to hide internal directories.