Skip to content

Commit

Permalink
Revise README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Dec 26, 2024
1 parent 7130214 commit f3b98d8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions promexporter/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Prometheus Groupcache Exporter

This exporter extracts statistics from groupcache instances and exports Prometheus metrics.
This exporter extracts statistics from group instances and exports as Prometheus metrics.

# Example
## Example

```go
import (
Expand All @@ -20,14 +20,17 @@ prometheus.MustRegister(collector)
group := groupcache.NewGroup("mygroup", cacheSize, getter)
```

## Exported Metrics
## Metrics

### Exported from groupcache's `CacheStats()`
- `groupcache_cache_bytes{group,type="main|hot"}`: Gauge of current bytes in use
- `groupcache_cache_evictions_nonexpired_total{group,type="main|hot"}`: Count of cache evictions for non-expired keys due to memory full
- `groupcache_cache_evictions_total{group,type="main|hot"}`: Count of cache evictions
- `groupcache_cache_gets_total{group,type="main|hot"}`: Count of cache gets
- `groupcache_cache_hits_total{group,type="main|hot"}`: Count of cache hits
- `groupcache_cache_items{group,type="main|hot"}`: Gauge of current items in use

### Exported from groupcache's `Stats()`
- `groupcache_get_from_peers_latency_lower{group}`: Represent slowest duration to request value from peers
- `groupcache_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)
Expand All @@ -39,6 +42,6 @@ group := groupcache.NewGroup("mygroup", cacheSize, getter)
- `groupcache_peer_loads_total{group}`: Count of loads or cache hits from peers
- `groupcache_server_requests_total{group}`: Count of gets received from peers

# Attribution
## Attribution

This package source was copied 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.
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.

0 comments on commit f3b98d8

Please sign in to comment.