Skip to content

Commit

Permalink
Use prometheus v2.9.2, common v0.4.0 & tsdb v0.8.0 (#1133)
Browse files Browse the repository at this point in the history
* Upgrade prometheus dependancies

- prometheus/[email protected]+incompatible
- prometheus/[email protected]
- prometheus/[email protected]

Signed-off-by: Sylvain Rabot <[email protected]>

* Rename tsdb_errors to tsdberrors

Signed-off-by: Sylvain Rabot <[email protected]>

* Update changelog

Signed-off-by: Sylvain Rabot <[email protected]>
  • Loading branch information
Sylvain Rabot authored and bwplotka committed May 31, 2019
1 parent 1ffa69a commit d5441f2
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 101 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ TL;DR: Store LRU cache is no longer leaking, Upgraded Thanos UI to Prometheus 2.
- [#1149](https://github.com/improbable-eng/thanos/pull/1149) Updated google Golang API deps (GCS bucket client).
- [#1190](https://github.com/improbable-eng/thanos/pull/1190) Updated minio deps (S3 bucket client). This fixes minio retries.

- [#1133](https://github.com/improbable-eng/thanos/pull/1133) Use prometheus v2.9.2, common v0.4.0 & tsdb v0.8.0.

Changes from the upstreams:
* store gateway:
- [ENHANCEMENT] Fast path for EmptyPostings cases in Merge, Intersect and Without.
* store gateway & compactor:
- [BUGFIX] Fix fd and vm_area leak on error path in chunks.NewDirReader.
- [BUGFIX] Fix fd and vm_area leak on error path in index.NewFileReader.
* query:
- [BUGFIX] Make sure subquery range is taken into account for selection #5467
- [ENHANCEMENT] Check for cancellation on every step of a range evaluation. #5131
- [BUGFIX] Exponentation operator to drop metric name in result of operation. #5329
- [BUGFIX] Fix output sample values for scalar-to-vector comparison operations. #5454
* rule:
- [BUGFIX] Reload rules: copy state on both name and labels. #5368

## Deprecated

- [#1008](https://github.com/improbable-eng/thanos/pull/1008) Removed Gossip implementation.
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ ME ?= $(shell whoami)
# Referenced by github.com/improbable-eng/thanos/blob/master/docs/getting_started.md#prometheus

# Limited prom version, because testing was not possible. This should fix it: https://github.com/improbable-eng/thanos/issues/758
PROM_VERSIONS ?=v2.4.3 v2.5.0 v2.8.1
PROM_VERSIONS ?= v2.4.3 v2.5.0 v2.8.1 v2.9.2

ALERTMANAGER_VERSION ?=v0.15.2
MINIO_SERVER_VERSION ?=RELEASE.2018-10-06T00-15-16Z
ALERTMANAGER_VERSION ?= v0.15.2
MINIO_SERVER_VERSION ?= RELEASE.2018-10-06T00-15-16Z

# fetch_go_bin_version downloads (go gets) the binary from specific version and installs it in $(GOBIN)/<bin>-<version>
# arguments:
Expand Down
21 changes: 9 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ require (
github.com/fortytw2/leaktest v1.3.0
github.com/fsnotify/fsnotify v1.4.7
github.com/go-kit/kit v0.8.0
github.com/gogo/protobuf v1.2.0
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
github.com/gogo/protobuf v1.2.1
github.com/golang/snappy v0.0.1
github.com/google/martian v2.1.0+incompatible // indirect
github.com/googleapis/gax-go v2.0.2+incompatible // indirect
github.com/gophercloud/gophercloud v0.0.0-20181206160319-9d88c34913a9
github.com/gophercloud/gophercloud v0.0.0-20190301152420-fca40860790e
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20181025070259-68e3a13e4117
github.com/hashicorp/golang-lru v0.5.1
github.com/julienschmidt/httprouter v1.1.0 // indirect
github.com/leanovate/gopter v0.2.4
github.com/lovoo/gcloud-opentracing v0.3.0
github.com/miekg/dns v1.1.8
Expand All @@ -32,19 +31,17 @@ require (
github.com/opentracing/basictracer-go v1.0.0
github.com/opentracing/opentracing-go v1.0.2
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/common v0.0.0-20181218105931-67670fe90761
github.com/prometheus/prometheus v0.0.0-20190328180107-4d60eb36dcbe
github.com/prometheus/tsdb v0.6.1
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 // indirect
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/prometheus/common v0.4.0
github.com/prometheus/prometheus v2.9.2+incompatible
github.com/prometheus/tsdb v0.8.0
golang.org/x/net v0.0.0-20190522155817-f3200d17e092
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
google.golang.org/api v0.5.0
google.golang.org/grpc v1.19.0
google.golang.org/api v0.3.2
google.golang.org/grpc v1.19.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/yaml.v2 v2.2.2
)
185 changes: 110 additions & 75 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/block/metadata/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func renameFile(logger log.Logger, from, to string) error {
return err
}

if err = fileutil.Fsync(pdir); err != nil {
if err = fileutil.Fdatasync(pdir); err != nil {
runutil.CloseWithLogOnErr(logger, pdir, "close dir")
return err
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/compact/downsample/downsample.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/chunkenc"
"github.com/prometheus/tsdb/chunks"
tsdberrors "github.com/prometheus/tsdb/errors"
"github.com/prometheus/tsdb/index"
"github.com/prometheus/tsdb/labels"
)
Expand Down Expand Up @@ -63,7 +64,7 @@ func Downsample(
// Remove blockDir in case of errors.
defer func() {
if err != nil {
var merr tsdb.MultiError
var merr tsdberrors.MultiError
merr.Add(err)
merr.Add(os.RemoveAll(blockDir))
err = merr.Err()
Expand Down
7 changes: 4 additions & 3 deletions pkg/compact/downsample/streamed_block_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/chunks"
"github.com/prometheus/tsdb/fileutil"
tsdberrors "github.com/prometheus/tsdb/errors"
"github.com/prometheus/tsdb/index"
"github.com/prometheus/tsdb/labels"
)
Expand Down Expand Up @@ -83,7 +84,7 @@ func NewStreamedBlockWriter(
// We should close any opened Closer up to an error.
defer func() {
if err != nil {
var merr tsdb.MultiError
var merr tsdberrors.MultiError
merr.Add(err)
for _, cl := range closers {
merr.Add(cl.Close())
Expand Down Expand Up @@ -169,7 +170,7 @@ func (w *streamedBlockWriter) Close() error {
}
w.finalized = true

merr := tsdb.MultiError{}
merr := tsdberrors.MultiError{}

if w.ignoreFinalize {
// Close open file descriptors anyway.
Expand Down Expand Up @@ -234,7 +235,7 @@ func (w *streamedBlockWriter) syncDir() (err error) {

defer runutil.CloseWithErrCapture(&err, df, "close temporary block blockDir")

if err := fileutil.Fsync(df); err != nil {
if err := fileutil.Fdatasync(df); err != nil {
return errors.Wrap(err, "sync temporary blockDir")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/pkg/errors"
"github.com/prometheus/prometheus/pkg/rulefmt"
"github.com/prometheus/prometheus/rules"
"github.com/prometheus/tsdb"
tsdberrors "github.com/prometheus/tsdb/errors"
yaml "gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -112,7 +112,7 @@ func (r RuleGroup) MarshalYAML() (interface{}, error) {
// special field in RuleGroup file.
func (m *Managers) Update(dataDir string, evalInterval time.Duration, files []string) error {
var (
errs tsdb.MultiError
errs tsdberrors.MultiError
filesMap = map[storepb.PartialResponseStrategy][]string{}
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/runutil/runutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus/tsdb"
tsdberrors "github.com/prometheus/tsdb/errors"
)

// Repeat executes f every interval seconds until stopc is closed.
Expand Down Expand Up @@ -111,7 +111,7 @@ func CloseWithLogOnErr(logger log.Logger, closer io.Closer, format string, a ...
// CloseWithErrCapture runs function and on error return error by argument including the given error (usually
// from caller function).
func CloseWithErrCapture(err *error, closer io.Closer, format string, a ...interface{}) {
merr := tsdb.MultiError{}
merr := tsdberrors.MultiError{}

merr.Add(*err)
merr.Add(errors.Wrapf(closer.Close(), format, a...))
Expand Down
2 changes: 1 addition & 1 deletion pkg/shipper/shipper.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func renameFile(logger log.Logger, from, to string) error {
return err
}

if err = fileutil.Fsync(pdir); err != nil {
if err = fileutil.Fdatasync(pdir); err != nil {
runutil.CloseWithLogOnErr(logger, pdir, "rename file dir close")
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutil/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

const (
defaultPrometheusVersion = "v2.4.3"
defaultPrometheusVersion = "v2.9.2"
defaultAlertmanagerVersion = "v0.15.2"
defaultMinioVersion = "RELEASE.2018-10-06T00-15-16Z"

Expand Down

0 comments on commit d5441f2

Please sign in to comment.