Skip to content

Commit

Permalink
docs: add changelog about redis cache (#4931)
Browse files Browse the repository at this point in the history
* docs: add changelog about redis cache

Signed-off-by: Jimmie Han <hanjinming@outlook.com>

* docs: fix comment

Signed-off-by: Jimmie Han <hanjinming@outlook.com>

* docs: fix typo

Signed-off-by: Jimmie Han <hanjinming@outlook.com>
  • Loading branch information
hanjm authored Dec 16, 2021
1 parent f527d26 commit d08da88
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#4903](https://github.com/thanos-io/thanos/pull/4903) Compactor: Added tracing support for compaction.
- [#4909](https://github.com/thanos-io/thanos/pull/4909) Compactor: Add flag --max-time / --min-time to filter blocks that are ready to be compacted.
- [#4942](https://github.com/thanos-io/thanos/pull/4942) Tracing: add `traceid_128bit` support for jaeger.
- [#4888](https://github.com/thanos-io/thanos/pull/4888) Cache: support redis cache backend.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion pkg/cacheutil/redis_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func NewRedisClientWithConfig(logger log.Logger, name string, config RedisClient
}
duration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
Name: "thanos_redis_operation_duration_seconds",
Help: "Duration of operations against memcached.",
Help: "Duration of operations against redis.",
Buckets: []float64{0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.2, 0.5, 1, 3, 6, 10},
}, []string{"operation"})
c.durationSet = duration.WithLabelValues(opSet)
Expand Down
1 change: 0 additions & 1 deletion pkg/queryfrontend/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (t thanosCacheKeyGenerator) GenerateCacheKey(userID string, r queryrange.Re
i := 0
for ; i < len(t.resolutions) && t.resolutions[i] > tr.MaxSourceResolution; i++ {
}
// Cache key should has a uniq prefix, We use `fe` represent frontend.
return fmt.Sprintf("fe:%s:%s:%d:%d:%d", userID, tr.Query, tr.Step, currentInterval, i)
case *ThanosLabelsRequest:
return fmt.Sprintf("fe:%s:%s:%s:%d", userID, tr.Label, tr.Matchers, currentInterval)
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/cache/caching_bucket_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewCachingBucketFromYaml(yamlContent []byte, bucket objstore.Bucket, logger
case string(RedisBucketCacheProvider):
redisCache, err := cacheutil.NewRedisClient(logger, "caching-bucket", backendConfig, reg)
if err != nil {
return nil, errors.Wrapf(err, "failed to create memcached client")
return nil, errors.Wrapf(err, "failed to create redis client")
}
c = cache.NewRedisCache("caching-bucket", logger, redisCache, reg)
default:
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/cache/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewRemoteIndexCache(logger log.Logger, cacheClient cacheutil.RemoteCacheCli
c.hits.WithLabelValues(cacheTypePostings)
c.hits.WithLabelValues(cacheTypeSeries)

level.Info(logger).Log("msg", "created cacheClient index cache")
level.Info(logger).Log("msg", "created index cache")

return c, nil
}
Expand Down

0 comments on commit d08da88

Please sign in to comment.