exporter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServerCertificateFunc

func GetServerCertificateFunc(certFile, keyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)

GetServerCertificateFunc returns a function for tls.Config.GetCertificate

func LoadKeyPair

func LoadKeyPair(certFile, keyFile string) (*tls.Certificate, error)

LoadKeyPair reads and parses a public/private key pair from a pair of files. The files must contain PEM encoded data.

func LoadPwdFile

func LoadPwdFile(passwordFile string) (map[string]string, error)

LoadPwdFile reads the redis password file and returns the password map

Types

type BuildInfo

type BuildInfo struct {
	Version   string
	CommitSha string
	Date      string
}

type Exporter

type Exporter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewKvrocksExporter

func NewKvrocksExporter(kvrocksURI string, opts Options) (*Exporter, error)

NewKvrocksExporter returns a new exporter of Kvrocks metrics.

func (*Exporter) Collect

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

Collect fetches new metrics from the KvrocksHost and updates the appropriate metrics.

func (*Exporter) CreateClientTLSConfig

func (e *Exporter) CreateClientTLSConfig() (*tls.Config, error)

CreateClientTLSConfig verifies configured files and return a prepared tls.Config

func (*Exporter) Describe

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

Describe outputs Redis metric descriptions.

func (*Exporter) ServeHTTP

func (e *Exporter) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	Password              string
	Namespace             string
	PasswordMap           map[string]string
	ConfigCommandName     string
	ClientCertFile        string
	ClientKeyFile         string
	CaCertFile            string
	InclSystemMetrics     bool
	SkipTLSVerification   bool
	SetClientName         bool
	IsCluster             bool
	ExportClientsInclPort bool
	ConnectionTimeouts    time.Duration
	MetricsPath           string
	KvrocksMetricsOnly    bool
	PingOnConnect         bool
	Registry              *prometheus.Registry
	BuildInfo             BuildInfo
}

Jump to

Keyboard shortcuts

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