diff --git a/go.mod b/go.mod index 6e2636bd..573caa01 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gin-gonic/gin v1.9.1 github.com/google/uuid v1.3.0 github.com/splitio/gincache v1.0.1 - github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155 + github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109143938-74c6638a98ec github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788 github.com/stretchr/testify v1.8.4 go.etcd.io/bbolt v1.3.6 diff --git a/go.sum b/go.sum index d6b4e045..403b77c8 100644 --- a/go.sum +++ b/go.sum @@ -92,6 +92,10 @@ github.com/splitio/gincache v1.0.1 h1:dLYdANY/BqH4KcUMCe/LluLyV5WtuE/LEdQWRE06IX github.com/splitio/gincache v1.0.1/go.mod h1:CcgJDSM9Af75kyBH0724v55URVwMBuSj5x1eCWIOECY= github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155 h1:SecApJYs4oumtZMIBwnE2DFyImlwiuswXIdZDaW42uE= github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I= +github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109140227-821edb4de9f5 h1:KVx3rhvvBc5aWKuWsvaxxHQAp//q+TmzH/Sdp70sULI= +github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109140227-821edb4de9f5/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I= +github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109143938-74c6638a98ec h1:fNlBnkJyOFJ13IUFCreLL0h1sj7bK6m8IkJGV64LXFk= +github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109143938-74c6638a98ec/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I= github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788 h1:URrg0BcgUzFE4pAacFlrWiTrmEdH4SY03XXLLWVtqLc= github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/splitio/producer/conf/sections.go b/splitio/producer/conf/sections.go index ba26d57e..d6b16349 100644 --- a/splitio/producer/conf/sections.go +++ b/splitio/producer/conf/sections.go @@ -103,6 +103,7 @@ type Redis struct { TLSSkipNameValidation bool `json:"tlsSkipNameValidation" s-cli:"redis-tls-skip-name-validation" s-def:"false" s-desc:"Blindly accept server's public key."` TLSClientCertificate string `json:"tlsClientCertificate" s-cli:"redis-tls-client-certificate" s-def:"" s-desc:"Client certificate signed by a known CA"` TLSClientKey string `json:"tlsClientKey" s-cli:"redis-tls-client-key" s-def:"" s-desc:"Client private key matching the certificate."` + ScanCount int `json:"scanCount" s-cli:"redis-scan-count" s-def:"10" s-desc:"It is the number of keys to search through at a time per cursor iteration, we use it to read feature flag names and flag set names."` } // Healthcheck configuration options diff --git a/splitio/producer/initialization.go b/splitio/producer/initialization.go index f1a865cb..884b4a6d 100644 --- a/splitio/producer/initialization.go +++ b/splitio/producer/initialization.go @@ -90,7 +90,7 @@ func Start(logger logging.LoggerInterface, cfg *conf.Main) error { flagSetsFilter := flagsets.NewFlagSetFilter(cfg.FlagSetsFilter) // These storages are forwarded to the dashboard, the sdk-telemetry is irrelevant there - splitStorage, err := observability.NewObservableSplitStorage(redis.NewSplitStorage(redisClient, logger, flagSetsFilter), logger) + splitStorage, err := observability.NewObservableSplitStorage(redis.NewSplitStorage(redisClient, logger, flagSetsFilter, int64(redisOptions.ScanCount)), logger) if err != nil { return fmt.Errorf("error instantiating observable feature flag storage: %w", err) } diff --git a/splitio/producer/util.go b/splitio/producer/util.go index f7cda7f2..d992e0be 100644 --- a/splitio/producer/util.go +++ b/splitio/producer/util.go @@ -99,6 +99,7 @@ func parseRedisOptions(cfg *conf.Redis) (*config.RedisConfig, error) { WriteTimeout: cfg.WriteTimeout, PoolSize: cfg.PoolSize, TLSConfig: tlsCfg, + ScanCount: cfg.ScanCount, } if cfg.SentinelReplication {