Skip to content

Commit

Permalink
chore(cache): Make exprimental messages more clear for cache. (#6219)
Browse files Browse the repository at this point in the history
Currently we see following message when any of the experimental feature is used for cache (say fifocache or redis).
But the problem it doesn't say __what_kind__ of cache is it exactly.

So this leads to confusion to track what kind of cache is the source of the experiment feature.

This PR fixes it by adding more clear message.

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
  • Loading branch information
kavirajk committed May 26, 2022
1 parent 410c1a0 commit a795b93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/storage/chunk/cache/fifo_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"container/list"
"context"
"flag"
"fmt"
"sync"
"time"
"unsafe"
Expand Down Expand Up @@ -98,7 +99,7 @@ type cacheEntry struct {

// NewFifoCache returns a new initialised FifoCache of size.
func NewFifoCache(name string, cfg FifoCacheConfig, reg prometheus.Registerer, logger log.Logger) *FifoCache {
util_log.WarnExperimentalUse("In-memory (FIFO) cache", logger)
util_log.WarnExperimentalUse(fmt.Sprintf("In-memory (FIFO) cache - %s", name), logger)

if cfg.DeprecatedSize > 0 {
flagext.DeprecatedFlagsUsed.Inc()
Expand Down
3 changes: 2 additions & 1 deletion pkg/storage/chunk/cache/redis_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cache

import (
"context"
"fmt"

"github.com/go-kit/log"
"github.com/go-kit/log/level"
Expand All @@ -18,7 +19,7 @@ type RedisCache struct {

// NewRedisCache creates a new RedisCache
func NewRedisCache(name string, redisClient *RedisClient, logger log.Logger) *RedisCache {
util_log.WarnExperimentalUse("Redis cache", logger)
util_log.WarnExperimentalUse(fmt.Sprintf("Redis cache - %s", name), logger)
cache := &RedisCache{
name: name,
redis: redisClient,
Expand Down

0 comments on commit a795b93

Please sign in to comment.