Skip to content

Commit dd23765

Browse files
authored
Print a warning when using an experimental feature (#2361)
* Print a warning when using an experimental feature Signed-off-by: Goutham Veeramachaneni <[email protected]> * Address feedback Signed-off-by: Goutham Veeramachaneni <[email protected]>
1 parent 4164e4b commit dd23765

File tree

13 files changed

+46
-2
lines changed

13 files changed

+46
-2
lines changed

pkg/chunk/azure/blob_storage_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/Azure/azure-storage-blob-go/azblob"
1414

1515
"github.com/cortexproject/cortex/pkg/chunk"
16+
"github.com/cortexproject/cortex/pkg/util"
1617
"github.com/cortexproject/cortex/pkg/util/flagext"
1718
)
1819

@@ -63,6 +64,7 @@ type BlobStorage struct {
6364

6465
// NewBlobStorage creates a new instance of the BlobStorage struct.
6566
func NewBlobStorage(cfg *BlobStorageConfig, delimiter string) (*BlobStorage, error) {
67+
util.WarnExperimentalUse("Azure Blob Storage")
6668
blobStorage := &BlobStorage{
6769
cfg: cfg,
6870
delimiter: delimiter,

pkg/chunk/cache/fifo_cache.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99

1010
"github.com/prometheus/client_golang/prometheus"
1111
"github.com/prometheus/client_golang/prometheus/promauto"
12+
13+
"github.com/cortexproject/cortex/pkg/util"
1214
)
1315

1416
var (
@@ -113,6 +115,8 @@ type cacheEntry struct {
113115
// NewFifoCache returns a new initialised FifoCache of size.
114116
// TODO(bwplotka): Fix metrics, get them out of globals, separate or allow prefixing.
115117
func NewFifoCache(name string, cfg FifoCacheConfig) *FifoCache {
118+
util.WarnExperimentalUse("In-memory (FIFO) cache")
119+
116120
cache := &FifoCache{
117121
size: cfg.Size,
118122
validity: cfg.Validity,

pkg/chunk/cache/memcached_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func NewMemcachedClient(cfg MemcachedClientConfig, name string, r prometheus.Reg
108108
}
109109

110110
if len(cfg.Addresses) > 0 {
111+
util.WarnExperimentalUse("DNS-based memcached service discovery")
111112
newClient.addresses = strings.Split(cfg.Addresses, ",")
112113
}
113114

pkg/chunk/cache/redis_cache.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (cfg *RedisConfig) RegisterFlagsWithPrefix(prefix, description string, f *f
4444

4545
// NewRedisCache creates a new RedisCache
4646
func NewRedisCache(cfg RedisConfig, name string, pool *redis.Pool) *RedisCache {
47+
util.WarnExperimentalUse("Redis cache")
4748
// pool != nil only in unit tests
4849
if pool == nil {
4950
pool = &redis.Pool{

pkg/chunk/cassandra/storage_client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
"github.com/cortexproject/cortex/pkg/chunk"
1616
"github.com/cortexproject/cortex/pkg/chunk/util"
17+
pkgutil "github.com/cortexproject/cortex/pkg/util"
1718
"github.com/cortexproject/cortex/pkg/util/flagext"
1819
)
1920

@@ -185,6 +186,8 @@ type StorageClient struct {
185186

186187
// NewStorageClient returns a new StorageClient.
187188
func NewStorageClient(cfg Config, schemaCfg chunk.SchemaConfig) (*StorageClient, error) {
189+
pkgutil.WarnExperimentalUse("Cassandra Backend")
190+
188191
session, err := cfg.session()
189192
if err != nil {
190193
return nil, errors.WithStack(err)

pkg/chunk/purger/purger.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ type DataPurger struct {
7575

7676
// NewDataPurger creates a new DataPurger
7777
func NewDataPurger(cfg Config, deleteStore *DeleteStore, chunkStore chunk.Store, storageClient chunk.ObjectClient) (*DataPurger, error) {
78+
util.WarnExperimentalUse("Delete series API")
79+
7880
dataPurger := DataPurger{
7981
cfg: cfg,
8082
deleteStore: deleteStore,

pkg/cortex/modules.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ func (t *Cortex) initRuler(cfg *Config) (serv services.Service, err error) {
440440
}
441441

442442
if cfg.Ruler.EnableAPI {
443+
util.WarnExperimentalUse("Ruler API")
444+
443445
subrouter := t.server.HTTP.PathPrefix(cfg.HTTPPrefix).Subrouter()
444446
t.ruler.RegisterRoutes(subrouter, t.httpAuthMiddleware)
445447
ruler.RegisterRulerServer(t.server.GRPC, t.ruler)

pkg/ingester/ingester_v2.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ type TSDBState struct {
7979

8080
// NewV2 returns a new Ingester that uses prometheus block storage instead of chunk storage
8181
func NewV2(cfg Config, clientConfig client.Config, limits *validation.Overrides, registerer prometheus.Registerer) (*Ingester, error) {
82+
util.WarnExperimentalUse("Blocks storage engine")
8283
bucketClient, err := cortex_tsdb.NewBucketClient(context.Background(), cfg.TSDBConfig, "cortex", util.Logger)
8384
if err != nil {
8485
return nil, errors.Wrap(err, "failed to create the bucket client")

pkg/ingester/wal.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ func newWAL(cfg WALConfig, userStatesFunc func() map[string]*userState, register
8282
return &noopWAL{}, nil
8383
}
8484

85+
util.WarnExperimentalUse("Chunks WAL")
86+
8587
var walRegistry prometheus.Registerer
8688
if registerer != nil {
8789
walRegistry = prometheus.WrapRegistererWith(prometheus.Labels{"kind": "wal"}, registerer)

pkg/querier/block.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type BlockQueryable struct {
3232

3333
// NewBlockQueryable returns a client to query a block store
3434
func NewBlockQueryable(cfg tsdb.Config, logLevel logging.Level, registerer prometheus.Registerer) (*BlockQueryable, error) {
35+
util.WarnExperimentalUse("Blocks storage engine")
3536
bucketClient, err := tsdb.NewBucketClient(context.Background(), cfg, "cortex-userstore", util.Logger)
3637
if err != nil {
3738
return nil, err

0 commit comments

Comments
 (0)