Skip to content

Commit

Permalink
Adding more buckets to loki_memcache_request_duration_seconds histogr…
Browse files Browse the repository at this point in the history
…am (#9431)

**What this PR does / why we need it**:
Users using extstore (with NVMe drives) may experience latencies higher
than the ~250ms max as previously defined.

---------

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
  • Loading branch information
Danny Kopping committed May 9, 2023
1 parent 0776a6d commit 6141347
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* [8732](https://github.com/grafana/loki/pull/8732) **abaguas**: azure: respect retry config before cancelling the context
* [9206](https://github.com/grafana/loki/pull/9206) **dannykopping**: Ruler: log rule evaluation detail.
* [9184](https://github.com/grafana/loki/pull/9184) **periklis**: Bump dskit to introduce IPv6 support for memberlist
* [9431](https://github.com/grafana/loki/pull/9431) **dannykopping**: Add more buckets to `loki_memcache_request_duration_seconds` metric; latencies can increase if using memcached with NVMe

##### Fixes

Expand Down
9 changes: 7 additions & 2 deletions pkg/storage/chunk/cache/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ func NewMemcached(cfg MemcachedConfig, client MemcachedClient, name string, reg
Namespace: "loki",
Name: "memcache_request_duration_seconds",
Help: "Total time spent in seconds doing memcache requests.",
// Memcached requests are very quick: smallest bucket is 16us, biggest is 1s
Buckets: prometheus.ExponentialBuckets(0.000016, 4, 8),
// 16us, 64us, 256us, 1.024ms, 4.096ms, 16.384ms, 65.536ms, 150ms, 250ms, 500ms, 1s
Buckets: append(prometheus.ExponentialBuckets(0.000016, 4, 7), []float64{
(150 * time.Millisecond).Seconds(),
(250 * time.Millisecond).Seconds(),
(500 * time.Millisecond).Seconds(),
(time.Second).Seconds(),
}...),
ConstLabels: prometheus.Labels{"name": name},
}, []string{"method", "status_code"}),
),
Expand Down

0 comments on commit 6141347

Please sign in to comment.