redis/extra/redisprometheus
Ankit Chahar 0374592cdd
Merge branch 'master' into ankit/add-custom-label-support
2024-01-08 15:38:25 +05:30
..
README.md feat(extra/redisprometheus): prometheus.Collector implementation for redis clients 2022-07-21 16:02:50 +02:00
collector.go Add custom label support in metric collector 2023-12-21 15:43:44 +05:30
go.mod 9.4.0 (#2862) 2024-01-07 12:27:07 +02:00
go.sum chore: release v9.0.4 (release.sh) (#2572) 2023-05-02 08:40:46 +03:00

README.md

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

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

Metrics

Name Type Description
pool_hit_total Counter metric number of times a connection was found in the pool
pool_miss_total Counter metric number of times a connection was not found in the pool
pool_timeout_total Counter metric number of times a timeout occurred when getting a connection from the pool
pool_conn_total_current Gauge metric current number of connections in the pool
pool_conn_idle_current Gauge metric current number of idle connections in the pool
pool_conn_stale_total Counter metric number of times a connection was removed from the pool because it was stale