diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e9ab494f..adb88d9ca1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/cacheutil/redis_client.go b/pkg/cacheutil/redis_client.go index 9b15585d60..e7cdec606b 100644 --- a/pkg/cacheutil/redis_client.go +++ b/pkg/cacheutil/redis_client.go @@ -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) diff --git a/pkg/queryfrontend/cache.go b/pkg/queryfrontend/cache.go index c41321e1e4..47b948c4c7 100644 --- a/pkg/queryfrontend/cache.go +++ b/pkg/queryfrontend/cache.go @@ -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) diff --git a/pkg/store/cache/caching_bucket_factory.go b/pkg/store/cache/caching_bucket_factory.go index 7ba4a6da81..f73e4a833d 100644 --- a/pkg/store/cache/caching_bucket_factory.go +++ b/pkg/store/cache/caching_bucket_factory.go @@ -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: diff --git a/pkg/store/cache/memcached.go b/pkg/store/cache/memcached.go index a103667c76..c997759a4e 100644 --- a/pkg/store/cache/memcached.go +++ b/pkg/store/cache/memcached.go @@ -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 }