redis/extra/redisprometheus
Monkey ad89a97fdc
chore: update go mod, Upgrade golang.org/x/net version to 0.7.0 (#2476)
Signed-off-by: monkey92t <golang@88.com>
2023-03-06 19:42:42 +08:00
..
README.md feat(extra/redisprometheus): prometheus.Collector implementation for redis clients 2022-07-21 16:02:50 +02:00
collector.go chore: update import path 2023-01-23 08:48:54 +02:00
go.mod chore: release v9.0.2 (release.sh) (#2412) 2023-02-01 10:13:41 +02:00
go.sum chore: update go mod, Upgrade golang.org/x/net version to 0.7.0 (#2476) 2023-03-06 19:42:42 +08: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