diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f033debe0..c8b3e3eddad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5759](https://github.com/thanos-io/thanos/pull/5759) Compact: Fix missing duration log key. - [#5799](https://github.com/thanos-io/thanos/pull/5799) Query Frontend: Fixed sharding behaviour for vector matches. Now queries with sharding should work properly where the query looks like: `foo and without (lbl) bar`. +## [v0.30.1](https://github.com/thanos-io/thanos/tree/release-0.30) - 4.01.2023 + +### Fixed + +- [#6009](https://github.com/thanos-io/thanos/pull/6009) Query Frontend/Store: fix duplicate metrics registration in Redis client + ## [v0.30.0](https://github.com/thanos-io/thanos/tree/release-0.30) - 2.01.2023 NOTE: Querier's `query.promql-engine` flag enabling new PromQL engine is now unhidden. We encourage users to use new experimental PromQL engine for efficiency reasons. diff --git a/VERSION b/VERSION index c25c8e5b741..1a44cad74d6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.30.0 +0.30.1 diff --git a/pkg/cacheutil/cacheutil_test.go b/pkg/cacheutil/cacheutil_test.go index 2eadea1871b..d47a9979721 100644 --- a/pkg/cacheutil/cacheutil_test.go +++ b/pkg/cacheutil/cacheutil_test.go @@ -16,7 +16,11 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain( + m, + // https://github.com/rueian/rueidis/blob/v0.0.90/pipe.go#L204. + goleak.IgnoreTopFunction("github.com/rueian/rueidis.(*pipe).backgroundPing"), + ) } func TestDoWithBatch(t *testing.T) { diff --git a/pkg/cacheutil/redis_client.go b/pkg/cacheutil/redis_client.go index ba1b5eee2d5..eb5afb5b594 100644 --- a/pkg/cacheutil/redis_client.go +++ b/pkg/cacheutil/redis_client.go @@ -175,6 +175,10 @@ func NewRedisClientWithConfig(logger log.Logger, name string, config RedisClient return nil, err } + if reg != nil { + reg = prometheus.WrapRegistererWith(prometheus.Labels{"name": name}, reg) + } + var tlsConfig *tls.Config if config.TLSEnabled { userTLSConfig := config.TLSConfig diff --git a/pkg/cacheutil/redis_client_test.go b/pkg/cacheutil/redis_client_test.go index 6b7ca51d6a2..79b72dfe61e 100644 --- a/pkg/cacheutil/redis_client_test.go +++ b/pkg/cacheutil/redis_client_test.go @@ -212,3 +212,19 @@ func TestValidateRedisConfig(t *testing.T) { } } + +func TestMultipleRedisClient(t *testing.T) { + s, err := miniredis.Run() + if err != nil { + testutil.Ok(t, err) + } + defer s.Close() + cfg := DefaultRedisClientConfig + cfg.Addr = s.Addr() + logger := log.NewLogfmtLogger(os.Stderr) + reg := prometheus.NewRegistry() + _, err = NewRedisClientWithConfig(logger, "test1", cfg, reg) + testutil.Ok(t, err) + _, err = NewRedisClientWithConfig(logger, "test2", cfg, reg) + testutil.Ok(t, err) +}