This exporter extracts statistics from group instances and exports as Prometheus metrics.
import (
"github.com/mailgun/groupcache/v2"
"github.com/mailgun/groupcache/v2/promexporter"
"github.com/prometheus/client_golang/prometheus"
)
// ...
collector := promexporter.NewExporter()
prometheus.MustRegister(collector)
// Collector will discover newly created group.
group := groupcache.NewGroup("mygroup", cacheSize, getter)
groupcache_cache_bytes{group,type="main|hot"}
: Gauge of current bytes in usegroupcache_cache_evictions_nonexpired_total{group,type="main|hot"}
: Count of cache evictions for non-expired keys due to memory fullgroupcache_cache_evictions_total{group,type="main|hot"}
: Count of cache evictionsgroupcache_cache_gets_total{group,type="main|hot"}
: Count of cache getsgroupcache_cache_hits_total{group,type="main|hot"}
: Count of cache hitsgroupcache_cache_items{group,type="main|hot"}
: Gauge of current items in use
groupcache_get_from_peers_latency_lower{group}
: Represent slowest duration to request value from peersgroupcache_gets_total{group}
: Count of cache gets (including from peers, from either main or hot caches)groupcache_hits_total{group}
: Count of cache hits (from either main or hot caches)groupcache_loads_deduped_total{group}
: Count of loads after singleflightgroupcache_loads_total{group}
: Count of (gets - hits)groupcache_local_load_errs_total{group}
: Count of load errors from local cachegroupcache_local_loads_total{group}
: Count of loads from local cachegroupcache_peer_errors_total{group}
: Count of errors from peersgroupcache_peer_loads_total{group}
: Count of loads or cache hits from peersgroupcache_server_requests_total{group}
: Count of gets received from peers
This package source originated from https://github.com/udhos/groupcache_exporter. See LICENSE for MIT license details impacting the contents of this package directory in addition to the LICENSE at the root of this repo for co-existing Apache license details.