Skip to content

Commit

Permalink
Cut patch release v0.32.3 (#6736)
Browse files Browse the repository at this point in the history
* Update thanos engine and Prometheus dependencies (#6664)

* Update thanos engine and Prometheus dependencies

This commit bumps thanos/promql-engine to latest main and resolves
breaking changes from the prometheus/prometheus dependency.

Signed-off-by: Filip Petkovski <[email protected]>

* Add changelog entry

Signed-off-by: Filip Petkovski <[email protected]>

* Avoid closing head more than once

Signed-off-by: Filip Petkovski <[email protected]>

* Remove call to t.TempDir()

Signed-off-by: Filip Petkovski <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>

* build(deps): bump github.com/prometheus/alertmanager (#6671)

Bumps [github.com/prometheus/alertmanager](https://github.com/prometheus/alertmanager) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/prometheus/alertmanager/releases)
- [Changelog](https://github.com/prometheus/alertmanager/blob/v0.25.1/CHANGELOG.md)
- [Commits](prometheus/alertmanager@v0.25.0...v0.25.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/alertmanager
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* store: add acceptance tests for label methods to bucket store (#6668)

Signed-off-by: Michael Hoffmann <[email protected]>

* Ruler: Add update label names routine for stateful ruler (#6689)

Signed-off-by: Saswata Mukherjee <[email protected]>

* Store: add some acceptance tests for label matching (#6691)

Signed-off-by: Michael Hoffmann <[email protected]>

* Store: fix regex matching with set that matches empty (#6692)

Signed-off-by: Michael Hoffmann <[email protected]>

* Store: add failing test for potential dedup issue (#6693)

Signed-off-by: Michael Hoffmann <[email protected]>

* Store: fix block dedup (#6697)

Signed-off-by: Michael Hoffmann <[email protected]>

* Add Shipper bytes uploaded metric #6438 (#6544)

* [FEAT] Add uploaded bytes metric

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Add PR number to log

Signed-off-by: rita.canavarro <[email protected]>

* [FIX] Log msg

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Clean code

Signed-off-by: rita.canavarro <[email protected]>

* [FIX] Remove shadow code

Signed-off-by: rita.canavarro <[email protected]>

* [FIX] Go format

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Update objstore

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Update objstore package

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Update storage.md

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Update erroring bucket

Signed-off-by: rita.canavarro <[email protected]>

* [FEAT] Update erroring bucket

Signed-off-by: rita.canavarro <[email protected]>

---------

Signed-off-by: rita.canavarro <[email protected]>

* Update objstore library to latest main (#6722)

This commit updates the obstore library to the latest main version
which optimizes the Iter operation to only request object names.

Signed-off-by: Filip Petkovski <[email protected]>

* Store: store responses should always be sorted (#6706)

* Store: always sort, just compare labelset in proxy heap

Signed-off-by: Michael Hoffmann <[email protected]>

* Store: add escape hatch to skip store resorting

Signed-off-by: Michael Hoffmann <[email protected]>

* Store: remove stringset

This is the wrong approach to detect if we need to resort. It cannot
detect if we might end up with an unsorted series set if we add
extLabels.

Signed-off-by: Michael Hoffmann <[email protected]>

* Docs: drop paragraph about deduplication on inner labels

Signed-off-by: Michael Hoffmann <[email protected]>

---------

Signed-off-by: Michael Hoffmann <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>

* Updates busybox SHA (#6724)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: fpetkovski <[email protected]>

* Cut patch release v0.32.3

Signed-off-by: Saswata Mukherjee <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: rita.canavarro <[email protected]>
Signed-off-by: GitHub <[email protected]>
Co-authored-by: Filip Petkovski <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Hoffmann <[email protected]>
Co-authored-by: Rita Canavarro <[email protected]>
Co-authored-by: Michael Hoffmann <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: fpetkovski <[email protected]>
  • Loading branch information
8 people authored Sep 20, 2023
1 parent 7f5c066 commit 3d98d7c
Show file tree
Hide file tree
Showing 33 changed files with 1,050 additions and 693 deletions.
12 changes: 6 additions & 6 deletions .busybox-versions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Auto generated by busybox-updater.sh. DO NOT EDIT
amd64=650cefc7292b429ac55e3f9cc49a55a4cdd58698474310bb280c5e57adebf40a
arm64=63e8d2c5aa02d37f81bc9bfd80b92bbc59b31a0099a990649b887f861264b3b5
arm=810be036d4e95b015f26c01ba999a2e14fde69b5af0c264fe607971a35ba3787
ppc64le=b698a18e2d756e00697a63ac749825ee8c3f8a50133b8998dbed092c474c1f46
riscv64=02a69336c173007423c0be20cfd1c8a76b3fd6d4696a5b7c19022be9a631688b
s390x=72832339f6003c44a4cdf9d576efa3ff19d5ce55e27198b4089528bf0dd04788
amd64=7926ace2c2ee4c8fd52ae5badcc409685bae02090f796e26ef7bb504245acaaa
arm64=2754fd36a6cd1753c82f7954477b9864a0d0d2f7825c9ad015f3f2ce58d82f14
arm=a2f2a8253820f58e0a9721045b9e5f61df2aef79d679a638e2b901d4be6e27df
ppc64le=5e26d389ce9d04cf55740944dab6d7896766fd21a5eca05201e0aef4eab96852
riscv64=d671b149d69a3497f12d802a2cb3bf490bc16d9f048583868176bd016f35da61
s390x=50895280c397af8998357e1a522a4f82774d6abeddc7a95bafeb10cb46692bba
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Removed

## [v0.32.3](https://github.com/thanos-io/thanos/tree/release-0.32) - 20.09.2023

### Fixed

- [#6692](https://github.com/thanos-io/thanos/pull/6692) Store: Fix matching bug when using empty alternative in regex matcher, for example (a||b).
- [#6679](https://github.com/thanos-io/thanos/pull/6697) Store: Fix block deduplication
- [#6706](https://github.com/thanos-io/thanos/pull/6706) Store: Series responses should always be sorted

### Added

### Changed

- [#6664](https://github.com/thanos-io/thanos/pull/6664) *: Update Prometheus to 2.46.1.
- [#6722](https://github.com/thanos-io/thanos/pull/6722) *: Optimize iterations on GCS buckets by requesting only object names.
- [#6544](https://github.com/thanos-io/thanos/pull/6500) Objstore: Update objstore to latest version which adds a new metric regarding uploaded TSDB bytes

### Removed

## [v0.32.2](https://github.com/thanos-io/thanos/tree/release-0.32) - 31.08.2023

### Fixed
Expand Down Expand Up @@ -46,6 +64,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Changed

- [#6664](https://github.com/thanos-io/thanos/pull/6664) *: Update Prometheus to 2.46.1.

### Removed

## [v0.32.0](https://github.com/thanos-io/thanos/tree/release-0.32) - 23.08.2023
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.32.2
0.32.3
6 changes: 3 additions & 3 deletions cmd/thanos/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ func (b *erroringBucket) IsObjNotFoundErr(err error) bool {
return b.bkt.IsObjNotFoundErr(err)
}

// IsCustomerManagedKeyError returns true if error means that customer managed key is invalid.
func (b *erroringBucket) IsCustomerManagedKeyError(err error) bool {
return b.bkt.IsCustomerManagedKeyError(err)
// IsAccessDeniedErr returns true if error means that access to the object was denied.
func (b *erroringBucket) IsAccessDeniedErr(err error) bool {
return b.bkt.IsAccessDeniedErr(err)
}

// Attributes returns information about the specified object.
Expand Down
18 changes: 2 additions & 16 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
"github.com/prometheus/prometheus/tsdb"
"github.com/prometheus/prometheus/tsdb/wlog"
"google.golang.org/grpc"
"gopkg.in/yaml.v2"

Expand Down Expand Up @@ -85,7 +86,7 @@ func registerReceive(app *extkingpin.App) {
OutOfOrderTimeWindow: int64(time.Duration(*conf.tsdbOutOfOrderTimeWindow) / time.Millisecond),
OutOfOrderCapMax: conf.tsdbOutOfOrderCapMax,
NoLockfile: conf.noLockFile,
WALCompression: conf.walCompression,
WALCompression: wlog.ParseCompressionType(conf.walCompression, string(wlog.CompressionSnappy)),
MaxExemplars: conf.tsdbMaxExemplars,
EnableExemplarStorage: conf.tsdbMaxExemplars > 0,
HeadChunksWriteQueueSize: int(conf.tsdbWriteQueueSize),
Expand Down Expand Up @@ -365,21 +366,6 @@ func runReceive(
grpcserver.WithTLSConfig(tlsCfg),
)

ctx, cancel := context.WithCancel(context.Background())
level.Debug(logger).Log("msg", "setting up periodic update for label names")
g.Add(func() error {
return runutil.Repeat(10*time.Second, ctx.Done(), func() error {
level.Debug(logger).Log("msg", "Starting label names update")

dbs.UpdateLabelNames(ctx)

level.Debug(logger).Log("msg", "Finished label names update")
return nil
})
}, func(err error) {
cancel()
})

g.Add(
func() error {
level.Info(logger).Log("msg", "listening for StoreAPI and WritableStoreAPI gRPC", "address", conf.grpcConfig.bindAddress)
Expand Down
5 changes: 3 additions & 2 deletions cmd/thanos/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/prometheus/prometheus/storage/remote"
"github.com/prometheus/prometheus/tsdb"
"github.com/prometheus/prometheus/tsdb/agent"
"github.com/prometheus/prometheus/tsdb/wlog"
"github.com/prometheus/prometheus/util/strutil"

"github.com/thanos-io/objstore"
Expand Down Expand Up @@ -166,11 +167,11 @@ func registerRule(app *extkingpin.App) {
MaxBlockDuration: int64(time.Duration(*tsdbBlockDuration) / time.Millisecond),
RetentionDuration: int64(time.Duration(*tsdbRetention) / time.Millisecond),
NoLockfile: *noLockFile,
WALCompression: *walCompression,
WALCompression: wlog.ParseCompressionType(*walCompression, string(wlog.CompressionSnappy)),
}

agentOpts := &agent.Options{
WALCompression: *walCompression,
WALCompression: wlog.ParseCompressionType(*walCompression, string(wlog.CompressionSnappy)),
NoLockfile: *noLockFile,
}

Expand Down
47 changes: 3 additions & 44 deletions cmd/thanos/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import (
"github.com/thanos-io/thanos/pkg/shipper"
"github.com/thanos-io/thanos/pkg/store"
"github.com/thanos-io/thanos/pkg/store/labelpb"
"github.com/thanos-io/thanos/pkg/stringset"
"github.com/thanos-io/thanos/pkg/targets"
"github.com/thanos-io/thanos/pkg/tls"
)
Expand Down Expand Up @@ -113,9 +112,8 @@ func runSidecar(
mint: conf.limitMinTime.PrometheusTimestamp(),
maxt: math.MaxInt64,

limitMinTime: conf.limitMinTime,
client: promclient.NewWithTracingClient(logger, httpClient, "thanos-sidecar"),
labelNamesSet: stringset.AllStrings(),
limitMinTime: conf.limitMinTime,
client: promclient.NewWithTracingClient(logger, httpClient, "thanos-sidecar"),
}

confContentYaml, err := conf.objStore.Content()
Expand Down Expand Up @@ -239,19 +237,6 @@ func runSidecar(
}, func(error) {
cancel()
})

g.Add(func() error {
return runutil.Repeat(10*time.Second, ctx.Done(), func() error {
level.Debug(logger).Log("msg", "Starting label names update")

m.UpdateLabelNames(context.Background())

level.Debug(logger).Log("msg", "Finished label names update")
return nil
})
}, func(err error) {
cancel()
})
}
{
ctx, cancel := context.WithCancel(context.Background())
Expand All @@ -264,7 +249,7 @@ func runSidecar(
{
c := promclient.NewWithTracingClient(logger, httpClient, httpconfig.ThanosUserAgent)

promStore, err := store.NewPrometheusStore(logger, reg, c, conf.prometheus.url, component.Sidecar, m.Labels, m.Timestamps, m.LabelNamesSet, m.Version)
promStore, err := store.NewPrometheusStore(logger, reg, c, conf.prometheus.url, component.Sidecar, m.Labels, m.Timestamps, m.Version)
if err != nil {
return errors.Wrap(err, "create Prometheus store")
}
Expand Down Expand Up @@ -434,8 +419,6 @@ type promMetadata struct {
limitMinTime thanosmodel.TimeOrDurationValue

client *promclient.Client

labelNamesSet stringset.Set
}

func (s *promMetadata) UpdateLabels(ctx context.Context) error {
Expand Down Expand Up @@ -463,30 +446,6 @@ func (s *promMetadata) UpdateTimestamps(mint, maxt int64) {
s.maxt = maxt
}

func (s *promMetadata) UpdateLabelNames(ctx context.Context) {
mint, _ := s.Timestamps()
labelNames, err := s.client.LabelNamesInGRPC(ctx, s.promURL, nil, mint, time.Now().UnixMilli())
if err != nil {
s.mtx.Lock()
defer s.mtx.Unlock()

s.labelNamesSet = stringset.AllStrings()
return
}

filter := stringset.NewFromStrings(labelNames...)
s.mtx.Lock()
s.labelNamesSet = filter
s.mtx.Unlock()
}

func (s *promMetadata) LabelNamesSet() stringset.Set {
s.mtx.Lock()
defer s.mtx.Unlock()

return s.labelNamesSet
}

func (s *promMetadata) Labels() labels.Labels {
s.mtx.Lock()
defer s.mtx.Unlock()
Expand Down
17 changes: 0 additions & 17 deletions cmd/thanos/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,23 +496,6 @@ func runStore(
})
}

{
ctx, cancel := context.WithCancel(context.Background())
level.Debug(logger).Log("msg", "setting up periodic update for label names")
g.Add(func() error {
return runutil.Repeat(10*time.Second, ctx.Done(), func() error {
level.Debug(logger).Log("msg", "Starting label names update")

bs.UpdateLabelNames()

level.Debug(logger).Log("msg", "Finished label names update")
return nil
})
}, func(err error) {
cancel()
})

}
// Add bucket UI for loaded blocks.
{
ins := extpromhttp.NewInstrumentationMiddleware(reg, nil)
Expand Down
10 changes: 0 additions & 10 deletions docs/components/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,6 @@ thanos query \

This logic can also be controlled via parameter on QueryAPI. More details below.

### Deduplication on non-external labels

In `v0.31.0` we have implemented an [optimization](../proposals-accepted/20221129-avoid-global-sort.md) which broke deduplication on non-external labels. We think that it was just a coincidence that deduplication worked at all on non-external labels in previous versions.

External labels always override any labels a series might have and this makes it so that it is possible to remove replica labels on series returned by a StoreAPI as an optimization. If deduplication happens on internal labels then that might lead to unsorted series from a StoreAPI and that breaks deduplication.

To fix this use-case, in 0.32.0 we've implemented a cuckoo filter on label names that is updated every 10 seconds. Using it we can detect whether deduplication was requested on internal labels. If that is the case then the series set is resorted before being sent off to the querier. It is strongly recommended to set replica labels which are external labels because otherwise the optimization cannot be applied and your queries will be slower by 20-30%.

In the future we have plans to expose this cuckoo filter through the InfoAPI. This will allow better scoping queries to StoreAPIs.

## Experimental PromQL Engine

By default, Thanos querier comes with standard Prometheus PromQL engine. However, when `--query.promql-engine=thanos` is specified, Thanos will use [experimental Thanos PromQL engine](http://github.com/thanos-community/promql-engine) which is a drop-in, efficient implementation of PromQL engine with query planner and optimizers.
Expand Down
1 change: 1 addition & 0 deletions docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ type: AZURE
config:
storage_account: ""
storage_account_key: ""
storage_connection_string: ""
container: ""
endpoint: ""
user_assigned_id: ""
Expand Down
Loading

0 comments on commit 3d98d7c

Please sign in to comment.