exporter

package
v1.72.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstanceRoleSlave = "slave"
)

Variables

This section is empty.

Functions

func GetConfigForClientFunc

func GetConfigForClientFunc(certFile, keyFile, caCertFile string) func(*tls.ClientHelloInfo) (*tls.Config, error)

GetConfigForClientFunc returns a function for tls.Config.GetConfigForClient

func GetServerCertificateFunc

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

GetServerCertificateFunc returns a function for tls.Config.GetCertificate

func LoadCAFile

func LoadCAFile(caFile string) (*x509.CertPool, error)

LoadCAFile reads and parses CA certificates from a file into a pool. The file must contain PEM encoded data.

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 ClientInfo

type ClientInfo struct {
	Id,
	Name,
	User,
	Flags,
	Db,
	Host,
	Port,
	Resp string
	CreatedAt,
	IdleSince,
	Sub,
	Psub,
	Ssub,
	Watch,
	Qbuf,
	QbufFree,
	Obl,
	Oll,
	OMem,
	TotMem int64
}

type Exporter

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

Exporter implements the prometheus.Exporter interface, and exports Redis metrics.

func NewRedisExporter

func NewRedisExporter(uri string, opts Options) (*Exporter, error)

NewRedisExporter returns a new exporter of Redis metrics.

func (*Exporter) Collect

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

Collect fetches new metrics from the RedisHost 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) CreateServerTLSConfig

func (e *Exporter) CreateServerTLSConfig(certFile, keyFile, caCertFile, minVersionString string) (*tls.Config, error)

CreateServerTLSConfig verifies configuration 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 {
	User                            string
	Password                        string
	Namespace                       string
	PasswordMap                     map[string]string
	ConfigCommandName               string
	CheckKeys                       string
	CheckSingleKeys                 string
	CheckStreams                    string
	CheckSingleStreams              string
	StreamsExcludeConsumerMetrics   bool
	CheckKeysBatchSize              int64
	CheckKeyGroups                  string
	MaxDistinctKeyGroups            int64
	CountKeys                       string
	LuaScript                       map[string][]byte
	LuaScriptReadOnly               bool
	ClientCertFile                  string
	ClientKeyFile                   string
	CaCertFile                      string
	InclConfigMetrics               bool
	InclModulesMetrics              bool
	InclSearchIndexesMetrics        bool
	InclSentinelPeerInfo            bool
	CheckSearchIndexes              string
	DisableExportingKeyValues       bool
	ExcludeLatencyHistogramMetrics  bool
	RedactConfigMetrics             bool
	InclSystemMetrics               bool
	SkipTLSVerification             bool
	SetClientName                   bool
	IsTile38                        bool
	IsCluster                       bool
	ClusterDiscoverHostnames        bool
	ExportClientList                bool
	ExportClientsInclPort           bool
	InclAofFileSize                 bool
	SlowlogHistoryEnabled           bool
	OverrideAofFilePath             string
	ConnectionTimeouts              time.Duration
	MetricsPath                     string
	RedisMetricsOnly                bool
	PingOnConnect                   bool
	RedisPwdFile                    string
	Registry                        *prometheus.Registry
	BuildInfo                       BuildInfo
	BasicAuthUsername               string
	BasicAuthPassword               string
	BasicAuthHashPassword           string
	SkipCheckKeysForRoleMaster      bool
	InclMetricsForEmptyDatabases    bool
	IsFalkorDB                      bool
	InclFalkorDBGraphMemory         bool
	ExcludeFalkorDBGraphMemoryAttrs bool
	MaxFalkorDBGraphMemoryGraphs    int64
	FalkorDBGraphMemoryCacheTTL     time.Duration
	AppendInstanceRoleLabel         bool
	DisableScrapeEndpoint           bool
}

Jump to

Keyboard shortcuts

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