Back to Go Redis

Prometheus Metric Collector

extra/redisprometheus/README.md

9.19.01.5 KB
Original Source

Prometheus Metric Collector

This package implements a prometheus.Collector for collecting metrics about the connection pool used by the various redis clients. Supported clients are redis.Client, redis.ClusterClient, redis.Ring and redis.UniversalClient.

Example

go
client := redis.NewClient(options)
collector := redisprometheus.NewCollector(namespace, subsystem, client)
prometheus.MustRegister(collector)

Metrics

NameTypeDescription
pool_hit_totalCounter metricnumber of times a connection was found in the pool
pool_miss_totalCounter metricnumber of times a connection was not found in the pool
pool_timeout_totalCounter metricnumber of times a timeout occurred when getting a connection from the pool
pool_conn_total_currentGauge metriccurrent number of connections in the pool
pool_conn_idle_currentGauge metriccurrent number of idle connections in the pool
pool_conn_stale_totalCounter metricnumber of times a connection was removed from the pool because it was stale