metrics

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNginxMetricsClient

func NewNginxMetricsClient(httpClient *http.Client) (*prometheusClient.NginxClient, error)

NewNginxMetricsClient creates an NginxClient to fetch stats from NGINX over an unix socket

func RunPrometheusListenerForNginx

func RunPrometheusListenerForNginx(port int, client *prometheusClient.NginxClient, registry *prometheus.Registry, constLabels map[string]string)

RunPrometheusListenerForNginx runs an http server to expose Prometheus metrics for NGINX

func RunPrometheusListenerForNginxPlus

func RunPrometheusListenerForNginxPlus(port int, nginxPlusCollector prometheus.Collector, registry *prometheus.Registry)

RunPrometheusListenerForNginxPlus runs an http server to expose Prometheus metrics for NGINX Plus

Types

type LatencyMetricsListener added in v1.9.0

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

LatencyMetricsListener implements the SyslogListener interface

func (LatencyMetricsListener) Run added in v1.9.0

func (l LatencyMetricsListener) Run()

Run reads from the unix connection until an unrecoverable error occurs or the connection is closed.

func (LatencyMetricsListener) Stop added in v1.9.0

func (l LatencyMetricsListener) Stop()

Stop closes the unix connection of the listener.

type SyslogFakeListener added in v1.9.0

type SyslogFakeListener struct{}

SyslogFakeListener is a fake implementation of the SyslogListener interface

func NewSyslogFakeServer added in v1.9.0

func NewSyslogFakeServer() *SyslogFakeListener

NewFakeSyslogServer returns a SyslogFakeListener

func (SyslogFakeListener) Run added in v1.9.0

func (s SyslogFakeListener) Run()

Run is a fake implementation of SyslogListener Run

func (SyslogFakeListener) Stop added in v1.9.0

func (s SyslogFakeListener) Stop()

Stop is a fake implementation of SyslogListener Stop

type SyslogListener added in v1.9.0

type SyslogListener interface {
	Run()
	Stop()
}

SyslogListener is an interface for syslog metrics listener that reads syslog metrics logged by nginx

func NewLatencyMetricsListener added in v1.9.0

func NewLatencyMetricsListener(sockPath string, c collectors.LatencyCollector) SyslogListener

NewLatencyMetricsListener returns a LatencyMetricsListener that listens over a unix socket for syslog messages from nginx.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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