Skip to content

Commit

Permalink
*: cut 0.30.1 (thanos-io#6017)
Browse files Browse the repository at this point in the history
* fix duplicate metrics registration in redis client (thanos-io#6009)

* fix duplicate metrics registration in redis client

Signed-off-by: Kama Huang <kamatogo13@gmail.com>

* fixed test

Signed-off-by: Kama Huang <kamatogo13@gmail.com>

Signed-off-by: Kama Huang <kamatogo13@gmail.com>

* *: cut 0.30.1

Add CHANGELOG entry.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Kama Huang <kamatogo13@gmail.com>
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Co-authored-by: Kama Huang <121007071+kama910@users.noreply.github.com>
  • Loading branch information
2 people authored and Nathaniel Graham committed May 18, 2023
1 parent 62d3df1 commit a514df7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

## Unreleased

## [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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.30.0
0.30.1
6 changes: 5 additions & 1 deletion pkg/cacheutil/cacheutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/cacheutil/redis_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions pkg/cacheutil/redis_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit a514df7

Please sign in to comment.